// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate iam_v1;
extern crate lazy_static;
extern crate location;
extern crate longrunning;
extern crate lro;
extern crate reqwest;
extern crate rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// Represents the metadata of the long-running operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Server-defined resource path for the target of the operation.
    pub target: std::string::String,

    /// Output only. Name of the verb executed by the operation.
    pub verb: std::string::String,

    /// Output only. Human-readable status of the operation, if any.
    pub status_message: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation
    /// of the operation. Operations that have been cancelled successfully
    /// have
    /// [google.longrunning.Operation.error][google.longrunning.Operation.error]
    /// value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
    /// corresponding to `Code.CANCELLED`.
    ///
    /// [google.longrunning.Operation.error]: longrunning::model::Operation::result
    /// [google.rpc.Status.code]: rpc::model::Status::code
    pub requested_cancellation: bool,

    /// Output only. API version used to start the operation.
    pub api_version: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl OperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::OperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::OperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [target][crate::model::OperationMetadata::target].
    pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target = v.into();
        self
    }

    /// Sets the value of [verb][crate::model::OperationMetadata::verb].
    pub fn set_verb<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.verb = v.into();
        self
    }

    /// Sets the value of [status_message][crate::model::OperationMetadata::status_message].
    pub fn set_status_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.status_message = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::OperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [api_version][crate::model::OperationMetadata::api_version].
    pub fn set_api_version<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_version = v.into();
        self
    }
}

impl wkt::message::Message for OperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.OperationMetadata"
    }
}

/// The ServiceConnectionMap resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConnectionMap {
    /// Immutable. The name of a ServiceConnectionMap.
    /// Format:
    /// projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map}
    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
    pub name: std::string::String,

    /// Output only. Time when the ServiceConnectionMap was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when the ServiceConnectionMap was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// A description of this resource.
    pub description: std::string::String,

    /// The service class identifier this ServiceConnectionMap is for.
    /// The user of ServiceConnectionMap create API needs to have
    /// networkconnecitivty.serviceclasses.use iam permission for the service
    /// class.
    pub service_class: std::string::String,

    /// Output only. The service class uri this ServiceConnectionMap is for.
    pub service_class_uri: std::string::String,

    /// Output only. The infrastructure used for connections between
    /// consumers/producers.
    pub infrastructure: crate::model::Infrastructure,

    /// The PSC configurations on producer side.
    pub producer_psc_configs:
        std::vec::Vec<crate::model::service_connection_map::ProducerPscConfig>,

    /// The PSC configurations on consumer side.
    pub consumer_psc_configs:
        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConfig>,

    /// Output only. PSC connection details on consumer side.
    pub consumer_psc_connections:
        std::vec::Vec<crate::model::service_connection_map::ConsumerPscConnection>,

    /// The token provided by the consumer. This token authenticates that the
    /// consumer can create a connection within the specified project and network.
    pub token: std::string::String,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceConnectionMap {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ServiceConnectionMap::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ServiceConnectionMap::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionMap::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ServiceConnectionMap::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionMap::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::ServiceConnectionMap::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::ServiceConnectionMap::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [service_class][crate::model::ServiceConnectionMap::service_class].
    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_class = v.into();
        self
    }

    /// Sets the value of [service_class_uri][crate::model::ServiceConnectionMap::service_class_uri].
    pub fn set_service_class_uri<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.service_class_uri = v.into();
        self
    }

    /// Sets the value of [infrastructure][crate::model::ServiceConnectionMap::infrastructure].
    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
        mut self,
        v: T,
    ) -> Self {
        self.infrastructure = v.into();
        self
    }

    /// Sets the value of [producer_psc_configs][crate::model::ServiceConnectionMap::producer_psc_configs].
    pub fn set_producer_psc_configs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::service_connection_map::ProducerPscConfig>,
    {
        use std::iter::Iterator;
        self.producer_psc_configs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [consumer_psc_configs][crate::model::ServiceConnectionMap::consumer_psc_configs].
    pub fn set_consumer_psc_configs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConfig>,
    {
        use std::iter::Iterator;
        self.consumer_psc_configs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [consumer_psc_connections][crate::model::ServiceConnectionMap::consumer_psc_connections].
    pub fn set_consumer_psc_connections<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::service_connection_map::ConsumerPscConnection>,
    {
        use std::iter::Iterator;
        self.consumer_psc_connections = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [token][crate::model::ServiceConnectionMap::token].
    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.token = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::ServiceConnectionMap::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::ServiceConnectionMap::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ServiceConnectionMap {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap"
    }
}

/// Defines additional types related to [ServiceConnectionMap].
pub mod service_connection_map {
    #[allow(unused_imports)]
    use super::*;

    /// The PSC configurations on producer side.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ProducerPscConfig {
        /// The resource path of a service attachment.
        /// Example:
        /// projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}.
        pub service_attachment_uri: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ProducerPscConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ProducerPscConfig::service_attachment_uri].
        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.service_attachment_uri = v.into();
            self
        }
    }

    impl wkt::message::Message for ProducerPscConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ProducerPscConfig"
        }
    }

    /// Allow the producer to specify which consumers can connect to it.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ConsumerPscConfig {
        /// The consumer project where PSC connections are allowed to be created in.
        pub project: std::string::String,

        /// The resource path of the consumer network where PSC connections are
        /// allowed to be created in. Note, this network does not need be in the
        /// ConsumerPscConfig.project in the case of SharedVPC.
        /// Example:
        /// projects/{projectNumOrId}/global/networks/{networkId}.
        pub network: std::string::String,

        /// This is used in PSC consumer ForwardingRule to control whether the PSC
        /// endpoint can be accessed from another region.
        pub disable_global_access: bool,

        /// Output only. Overall state of PSC Connections management for this
        /// consumer psc config.
        pub state: crate::model::service_connection_map::consumer_psc_config::State,

        /// Immutable. Deprecated. Use producer_instance_metadata instead.
        /// An immutable identifier for the producer instance.
        #[deprecated]
        pub producer_instance_id: std::string::String,

        /// Output only. A map to store mapping between customer vip and target
        /// service attachment. Only service attachment with producer specified ip
        /// addresses are stored here.
        pub service_attachment_ip_address_map:
            std::collections::HashMap<std::string::String, std::string::String>,

        /// Required. The project ID or project number of the consumer project. This
        /// project is the one that the consumer uses to interact with the producer
        /// instance. From the perspective of a consumer who's created a producer
        /// instance, this is the project of the producer instance. Format:
        /// 'projects/<project_id_or_number>' Eg. 'projects/consumer-project' or
        /// 'projects/1234'
        pub consumer_instance_project: std::string::String,

        /// Immutable. An immutable map for the producer instance metadata.
        pub producer_instance_metadata:
            std::collections::HashMap<std::string::String, std::string::String>,

        /// The requested IP version for the PSC connection.
        pub ip_version: std::option::Option<crate::model::IPVersion>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ConsumerPscConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConfig::project].
        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.project = v.into();
            self
        }

        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConfig::network].
        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.network = v.into();
            self
        }

        /// Sets the value of [disable_global_access][crate::model::service_connection_map::ConsumerPscConfig::disable_global_access].
        pub fn set_disable_global_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.disable_global_access = v.into();
            self
        }

        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConfig::state].
        pub fn set_state<
            T: std::convert::Into<crate::model::service_connection_map::consumer_psc_config::State>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_id].
        #[deprecated]
        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.producer_instance_id = v.into();
            self
        }

        /// Sets the value of [service_attachment_ip_address_map][crate::model::service_connection_map::ConsumerPscConfig::service_attachment_ip_address_map].
        pub fn set_service_attachment_ip_address_map<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.service_attachment_ip_address_map =
                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }

        /// Sets the value of [consumer_instance_project][crate::model::service_connection_map::ConsumerPscConfig::consumer_instance_project].
        pub fn set_consumer_instance_project<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.consumer_instance_project = v.into();
            self
        }

        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConfig::producer_instance_metadata].
        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.producer_instance_metadata =
                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }

        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
        pub fn set_ip_version<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IPVersion>,
        {
            self.ip_version = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConfig::ip_version].
        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IPVersion>,
        {
            self.ip_version = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for ConsumerPscConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig"
        }
    }

    /// Defines additional types related to [ConsumerPscConfig].
    pub mod consumer_psc_config {
        #[allow(unused_imports)]
        use super::*;

        /// PSC Consumer Config State.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum State {
            /// Default state, when Connection Map is created initially.
            Unspecified,
            /// Set when policy and map configuration is valid,
            /// and their matching can lead to allowing creation of PSC Connections
            /// subject to other constraints like connections limit.
            Valid,
            /// No Service Connection Policy found for this network and Service
            /// Class
            ConnectionPolicyMissing,
            /// Service Connection Policy limit reached for this network and Service
            /// Class
            PolicyLimitReached,
            /// The consumer instance project is not in
            /// AllowedGoogleProducersResourceHierarchyLevels of the matching
            /// ServiceConnectionPolicy.
            ConsumerInstanceProjectNotAllowlisted,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [State::value] or
            /// [State::name].
            UnknownValue(state::UnknownValue),
        }

        #[doc(hidden)]
        pub mod state {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl State {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Valid => std::option::Option::Some(1),
                    Self::ConnectionPolicyMissing => std::option::Option::Some(2),
                    Self::PolicyLimitReached => std::option::Option::Some(3),
                    Self::ConsumerInstanceProjectNotAllowlisted => std::option::Option::Some(4),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                    Self::Valid => std::option::Option::Some("VALID"),
                    Self::ConnectionPolicyMissing => {
                        std::option::Option::Some("CONNECTION_POLICY_MISSING")
                    }
                    Self::PolicyLimitReached => std::option::Option::Some("POLICY_LIMIT_REACHED"),
                    Self::ConsumerInstanceProjectNotAllowlisted => {
                        std::option::Option::Some("CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED")
                    }
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for State {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for State {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for State {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Valid,
                    2 => Self::ConnectionPolicyMissing,
                    3 => Self::PolicyLimitReached,
                    4 => Self::ConsumerInstanceProjectNotAllowlisted,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for State {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "STATE_UNSPECIFIED" => Self::Unspecified,
                    "VALID" => Self::Valid,
                    "CONNECTION_POLICY_MISSING" => Self::ConnectionPolicyMissing,
                    "POLICY_LIMIT_REACHED" => Self::PolicyLimitReached,
                    "CONSUMER_INSTANCE_PROJECT_NOT_ALLOWLISTED" => {
                        Self::ConsumerInstanceProjectNotAllowlisted
                    }
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for State {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Valid => serializer.serialize_i32(1),
                    Self::ConnectionPolicyMissing => serializer.serialize_i32(2),
                    Self::PolicyLimitReached => serializer.serialize_i32(3),
                    Self::ConsumerInstanceProjectNotAllowlisted => serializer.serialize_i32(4),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for State {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConfig.State"))
            }
        }
    }

    /// PSC connection details on consumer side.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct ConsumerPscConnection {
        /// The URI of a service attachment which is the target of the PSC
        /// connection.
        pub service_attachment_uri: std::string::String,

        /// The state of the PSC connection.
        pub state: crate::model::service_connection_map::consumer_psc_connection::State,

        /// The consumer project whose PSC forwarding rule is connected to the
        /// service attachments in this service connection map.
        pub project: std::string::String,

        /// The consumer network whose PSC forwarding rule is connected to the
        /// service attachments in this service connection map.
        /// Note that the network could be on a different project (shared VPC).
        pub network: std::string::String,

        /// The PSC connection id of the PSC forwarding rule connected
        /// to the service attachments in this service connection map.
        pub psc_connection_id: std::string::String,

        /// The IP literal allocated on the consumer network for the PSC forwarding
        /// rule that is created to connect to the producer service attachment in
        /// this service connection map.
        pub ip: std::string::String,

        /// The error type indicates whether the error is consumer facing, producer
        /// facing or system internal.
        #[deprecated]
        pub error_type: crate::model::ConnectionErrorType,

        /// The most recent error during operating this connection.
        #[deprecated]
        pub error: std::option::Option<rpc::model::Status>,

        /// The last Compute Engine operation to setup PSC connection.
        pub gce_operation: std::string::String,

        /// The URI of the consumer forwarding rule created.
        /// Example:
        /// projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}.
        pub forwarding_rule: std::string::String,

        /// Output only. The error info for the latest error during operating this
        /// connection.
        pub error_info: std::option::Option<rpc::model::ErrorInfo>,

        /// Output only. The URI of the selected subnetwork selected to allocate IP
        /// address for this connection.
        pub selected_subnetwork: std::string::String,

        /// Immutable. Deprecated. Use producer_instance_metadata instead.
        /// An immutable identifier for the producer instance.
        #[deprecated]
        pub producer_instance_id: std::string::String,

        /// Immutable. An immutable map for the producer instance metadata.
        pub producer_instance_metadata:
            std::collections::HashMap<std::string::String, std::string::String>,

        /// The requested IP version for the PSC connection.
        pub ip_version: std::option::Option<crate::model::IPVersion>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl ConsumerPscConnection {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [service_attachment_uri][crate::model::service_connection_map::ConsumerPscConnection::service_attachment_uri].
        pub fn set_service_attachment_uri<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.service_attachment_uri = v.into();
            self
        }

        /// Sets the value of [state][crate::model::service_connection_map::ConsumerPscConnection::state].
        pub fn set_state<
            T: std::convert::Into<
                    crate::model::service_connection_map::consumer_psc_connection::State,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [project][crate::model::service_connection_map::ConsumerPscConnection::project].
        pub fn set_project<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.project = v.into();
            self
        }

        /// Sets the value of [network][crate::model::service_connection_map::ConsumerPscConnection::network].
        pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.network = v.into();
            self
        }

        /// Sets the value of [psc_connection_id][crate::model::service_connection_map::ConsumerPscConnection::psc_connection_id].
        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.psc_connection_id = v.into();
            self
        }

        /// Sets the value of [ip][crate::model::service_connection_map::ConsumerPscConnection::ip].
        pub fn set_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.ip = v.into();
            self
        }

        /// Sets the value of [error_type][crate::model::service_connection_map::ConsumerPscConnection::error_type].
        #[deprecated]
        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
            mut self,
            v: T,
        ) -> Self {
            self.error_type = v.into();
            self
        }

        /// Sets the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
        #[deprecated]
        pub fn set_error<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<rpc::model::Status>,
        {
            self.error = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [error][crate::model::service_connection_map::ConsumerPscConnection::error].
        #[deprecated]
        pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<rpc::model::Status>,
        {
            self.error = v.map(|x| x.into());
            self
        }

        /// Sets the value of [gce_operation][crate::model::service_connection_map::ConsumerPscConnection::gce_operation].
        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.gce_operation = v.into();
            self
        }

        /// Sets the value of [forwarding_rule][crate::model::service_connection_map::ConsumerPscConnection::forwarding_rule].
        pub fn set_forwarding_rule<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.forwarding_rule = v.into();
            self
        }

        /// Sets the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
        pub fn set_error_info<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<rpc::model::ErrorInfo>,
        {
            self.error_info = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [error_info][crate::model::service_connection_map::ConsumerPscConnection::error_info].
        pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<rpc::model::ErrorInfo>,
        {
            self.error_info = v.map(|x| x.into());
            self
        }

        /// Sets the value of [selected_subnetwork][crate::model::service_connection_map::ConsumerPscConnection::selected_subnetwork].
        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.selected_subnetwork = v.into();
            self
        }

        /// Sets the value of [producer_instance_id][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_id].
        #[deprecated]
        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.producer_instance_id = v.into();
            self
        }

        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_map::ConsumerPscConnection::producer_instance_metadata].
        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.producer_instance_metadata =
                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }

        /// Sets the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
        pub fn set_ip_version<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IPVersion>,
        {
            self.ip_version = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [ip_version][crate::model::service_connection_map::ConsumerPscConnection::ip_version].
        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IPVersion>,
        {
            self.ip_version = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for ConsumerPscConnection {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection"
        }
    }

    /// Defines additional types related to [ConsumerPscConnection].
    pub mod consumer_psc_connection {
        #[allow(unused_imports)]
        use super::*;

        /// The state of the PSC connection.
        /// We reserve the right to add more states without notice in the future.
        /// Users should not use exhaustive switch statements on this enum.
        /// See <https://google.aip.dev/216>.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum State {
            /// An invalid state as the default case.
            Unspecified,
            /// The connection has been created successfully. However, for the
            /// up-to-date connection status, please use the service attachment's
            /// "ConnectedEndpoint.status" as the source of truth.
            Active,
            /// The connection is not functional since some resources on the connection
            /// fail to be created.
            Failed,
            /// The connection is being created.
            Creating,
            /// The connection is being deleted.
            Deleting,
            /// The connection is being repaired to complete creation.
            CreateRepairing,
            /// The connection is being repaired to complete deletion.
            DeleteRepairing,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [State::value] or
            /// [State::name].
            UnknownValue(state::UnknownValue),
        }

        #[doc(hidden)]
        pub mod state {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl State {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Active => std::option::Option::Some(1),
                    Self::Failed => std::option::Option::Some(2),
                    Self::Creating => std::option::Option::Some(3),
                    Self::Deleting => std::option::Option::Some(4),
                    Self::CreateRepairing => std::option::Option::Some(5),
                    Self::DeleteRepairing => std::option::Option::Some(6),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                    Self::Active => std::option::Option::Some("ACTIVE"),
                    Self::Failed => std::option::Option::Some("FAILED"),
                    Self::Creating => std::option::Option::Some("CREATING"),
                    Self::Deleting => std::option::Option::Some("DELETING"),
                    Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
                    Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for State {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for State {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for State {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Active,
                    2 => Self::Failed,
                    3 => Self::Creating,
                    4 => Self::Deleting,
                    5 => Self::CreateRepairing,
                    6 => Self::DeleteRepairing,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for State {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "STATE_UNSPECIFIED" => Self::Unspecified,
                    "ACTIVE" => Self::Active,
                    "FAILED" => Self::Failed,
                    "CREATING" => Self::Creating,
                    "DELETING" => Self::Deleting,
                    "CREATE_REPAIRING" => Self::CreateRepairing,
                    "DELETE_REPAIRING" => Self::DeleteRepairing,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for State {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Active => serializer.serialize_i32(1),
                    Self::Failed => serializer.serialize_i32(2),
                    Self::Creating => serializer.serialize_i32(3),
                    Self::Deleting => serializer.serialize_i32(4),
                    Self::CreateRepairing => serializer.serialize_i32(5),
                    Self::DeleteRepairing => serializer.serialize_i32(6),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for State {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                    ".google.cloud.networkconnectivity.v1.ServiceConnectionMap.ConsumerPscConnection.State"))
            }
        }
    }
}

/// Request for ListServiceConnectionMaps.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionMapsRequest {
    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
    pub parent: std::string::String,

    /// The maximum number of results per page that should be returned.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// A filter expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceConnectionMapsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListServiceConnectionMapsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListServiceConnectionMapsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListServiceConnectionMapsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListServiceConnectionMapsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListServiceConnectionMapsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListServiceConnectionMapsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsRequest"
    }
}

/// Response for ListServiceConnectionMaps.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionMapsResponse {
    /// ServiceConnectionMaps to be returned.
    pub service_connection_maps: std::vec::Vec<crate::model::ServiceConnectionMap>,

    /// The next pagination token in the List response. It should be used as
    /// page_token for the following request. An empty value means no more result.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceConnectionMapsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service_connection_maps][crate::model::ListServiceConnectionMapsResponse::service_connection_maps].
    pub fn set_service_connection_maps<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ServiceConnectionMap>,
    {
        use std::iter::Iterator;
        self.service_connection_maps = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionMapsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListServiceConnectionMapsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListServiceConnectionMapsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionMapsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListServiceConnectionMapsResponse {
    type PageItem = crate::model::ServiceConnectionMap;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.service_connection_maps
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for GetServiceConnectionMap.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceConnectionMapRequest {
    /// Required. Name of the ServiceConnectionMap to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetServiceConnectionMapRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetServiceConnectionMapRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetServiceConnectionMapRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionMapRequest"
    }
}

/// Request for CreateServiceConnectionMap.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceConnectionMapRequest {
    /// Required. The parent resource's name of the ServiceConnectionMap. ex.
    /// projects/123/locations/us-east1
    pub parent: std::string::String,

    /// Optional. Resource ID
    /// (i.e. 'foo' in '[...]/projects/p/locations/l/serviceConnectionMaps/foo')
    /// See <https://google.aip.dev/122#resource-id-segments>
    /// Unique per location.
    /// If one is not provided, one will be generated.
    pub service_connection_map_id: std::string::String,

    /// Required. Initial values for a new ServiceConnectionMaps
    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateServiceConnectionMapRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateServiceConnectionMapRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [service_connection_map_id][crate::model::CreateServiceConnectionMapRequest::service_connection_map_id].
    pub fn set_service_connection_map_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.service_connection_map_id = v.into();
        self
    }

    /// Sets the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
    pub fn set_service_connection_map<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionMap>,
    {
        self.service_connection_map = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_connection_map][crate::model::CreateServiceConnectionMapRequest::service_connection_map].
    pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionMap>,
    {
        self.service_connection_map = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateServiceConnectionMapRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateServiceConnectionMapRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionMapRequest"
    }
}

/// Request for UpdateServiceConnectionMap.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceConnectionMapRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// ServiceConnectionMap resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. New values to be patched into the resource.
    pub service_connection_map: std::option::Option<crate::model::ServiceConnectionMap>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateServiceConnectionMapRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionMapRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
    pub fn set_service_connection_map<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionMap>,
    {
        self.service_connection_map = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_connection_map][crate::model::UpdateServiceConnectionMapRequest::service_connection_map].
    pub fn set_or_clear_service_connection_map<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionMap>,
    {
        self.service_connection_map = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionMapRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateServiceConnectionMapRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionMapRequest"
    }
}

/// Request for DeleteServiceConnectionMap.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceConnectionMapRequest {
    /// Required. The name of the ServiceConnectionMap to delete.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteServiceConnectionMapRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteServiceConnectionMapRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionMapRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionMapRequest::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DeleteServiceConnectionMapRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionMapRequest"
    }
}

/// The ServiceConnectionPolicy resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConnectionPolicy {
    /// Immutable. The name of a ServiceConnectionPolicy.
    /// Format:
    /// projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy}
    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
    pub name: std::string::String,

    /// Output only. Time when the ServiceConnectionPolicy was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when the ServiceConnectionPolicy was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// A description of this resource.
    pub description: std::string::String,

    /// The resource path of the consumer network.
    /// Example:
    ///
    /// - projects/{projectNumOrId}/global/networks/{resourceId}.
    pub network: std::string::String,

    /// The service class identifier for which this ServiceConnectionPolicy is for.
    /// The service class identifier is a unique, symbolic representation of a
    /// ServiceClass. It is provided by the Service Producer. Google services have
    /// a prefix of gcp or google-cloud. For example, gcp-memorystore-redis or
    /// google-cloud-sql. 3rd party services do not. For example,
    /// test-service-a3dfcx.
    pub service_class: std::string::String,

    /// Output only. The type of underlying resources used to create the
    /// connection.
    pub infrastructure: crate::model::Infrastructure,

    /// Configuration used for Private Service Connect connections. Used when
    /// Infrastructure is PSC.
    pub psc_config: std::option::Option<crate::model::service_connection_policy::PscConfig>,

    /// Output only. [Output only] Information about each Private Service Connect
    /// connection.
    pub psc_connections: std::vec::Vec<crate::model::service_connection_policy::PscConnection>,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceConnectionPolicy {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ServiceConnectionPolicy::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionPolicy::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionPolicy::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::ServiceConnectionPolicy::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::ServiceConnectionPolicy::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [network][crate::model::ServiceConnectionPolicy::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [service_class][crate::model::ServiceConnectionPolicy::service_class].
    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_class = v.into();
        self
    }

    /// Sets the value of [infrastructure][crate::model::ServiceConnectionPolicy::infrastructure].
    pub fn set_infrastructure<T: std::convert::Into<crate::model::Infrastructure>>(
        mut self,
        v: T,
    ) -> Self {
        self.infrastructure = v.into();
        self
    }

    /// Sets the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
    pub fn set_psc_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
    {
        self.psc_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [psc_config][crate::model::ServiceConnectionPolicy::psc_config].
    pub fn set_or_clear_psc_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::service_connection_policy::PscConfig>,
    {
        self.psc_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [psc_connections][crate::model::ServiceConnectionPolicy::psc_connections].
    pub fn set_psc_connections<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::service_connection_policy::PscConnection>,
    {
        use std::iter::Iterator;
        self.psc_connections = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [etag][crate::model::ServiceConnectionPolicy::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::ServiceConnectionPolicy::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ServiceConnectionPolicy {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy"
    }
}

/// Defines additional types related to [ServiceConnectionPolicy].
pub mod service_connection_policy {
    #[allow(unused_imports)]
    use super::*;

    /// Configuration used for Private Service Connect connections. Used when
    /// Infrastructure is PSC.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PscConfig {
        /// The resource paths of subnetworks to use for IP address management.
        /// Example:
        /// projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.
        pub subnetworks: std::vec::Vec<std::string::String>,

        /// Optional. Max number of PSC connections for this policy.
        pub limit: std::option::Option<i64>,

        /// Required. ProducerInstanceLocation is used to specify which authorization
        /// mechanism to use to determine which projects the Producer instance can be
        /// within.
        pub producer_instance_location:
            crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,

        /// Optional. List of Projects, Folders, or Organizations from where the
        /// Producer instance can be within. For example, a network administrator can
        /// provide both 'organizations/foo' and 'projects/bar' as
        /// allowed_google_producers_resource_hierarchy_levels. This allowlists this
        /// network to connect with any Producer instance within the 'foo'
        /// organization or the 'bar' project. By default,
        /// allowed_google_producers_resource_hierarchy_level is empty. The format
        /// for each allowed_google_producers_resource_hierarchy_level is \<resource
        /// type\>/\<id\> where <resource type\> is one of 'projects', 'folders', or
        /// 'organizations' and \<id\> is either the ID or the number of the resource
        /// type. Format for each allowed_google_producers_resource_hierarchy_level
        /// value: 'projects/<project_id_or_number>' or 'folders/<folder_id>' or
        /// 'organizations/<organization_id>'
        /// Eg. [projects/my-project-id, projects/567, folders/891,
        /// organizations/123]
        pub allowed_google_producers_resource_hierarchy_level: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PscConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [subnetworks][crate::model::service_connection_policy::PscConfig::subnetworks].
        pub fn set_subnetworks<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.subnetworks = v.into_iter().map(|i| i.into()).collect();
            self
        }

        /// Sets the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
        pub fn set_limit<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.limit = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [limit][crate::model::service_connection_policy::PscConfig::limit].
        pub fn set_or_clear_limit<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i64>,
        {
            self.limit = v.map(|x| x.into());
            self
        }

        /// Sets the value of [producer_instance_location][crate::model::service_connection_policy::PscConfig::producer_instance_location].
        pub fn set_producer_instance_location<
            T: std::convert::Into<
                    crate::model::service_connection_policy::psc_config::ProducerInstanceLocation,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.producer_instance_location = v.into();
            self
        }

        /// Sets the value of [allowed_google_producers_resource_hierarchy_level][crate::model::service_connection_policy::PscConfig::allowed_google_producers_resource_hierarchy_level].
        pub fn set_allowed_google_producers_resource_hierarchy_level<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.allowed_google_producers_resource_hierarchy_level =
                v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for PscConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig"
        }
    }

    /// Defines additional types related to [PscConfig].
    pub mod psc_config {
        #[allow(unused_imports)]
        use super::*;

        /// ProducerInstanceLocation is used to specify which authorization mechanism
        /// to use to determine which projects the Producer instance can be within.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum ProducerInstanceLocation {
            /// Producer instance location is not specified. When this option is
            /// chosen, then the PSC connections created by this
            /// ServiceConnectionPolicy must be within the same project as the Producer
            /// instance. This is the default ProducerInstanceLocation value.
            /// To allow for PSC connections from this network to other networks, use
            /// the CUSTOM_RESOURCE_HIERARCHY_LEVELS option.
            Unspecified,
            /// Producer instance must be within one of the values provided in
            /// allowed_google_producers_resource_hierarchy_level.
            CustomResourceHierarchyLevels,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [ProducerInstanceLocation::value] or
            /// [ProducerInstanceLocation::name].
            UnknownValue(producer_instance_location::UnknownValue),
        }

        #[doc(hidden)]
        pub mod producer_instance_location {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl ProducerInstanceLocation {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::CustomResourceHierarchyLevels => std::option::Option::Some(1),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => {
                        std::option::Option::Some("PRODUCER_INSTANCE_LOCATION_UNSPECIFIED")
                    }
                    Self::CustomResourceHierarchyLevels => {
                        std::option::Option::Some("CUSTOM_RESOURCE_HIERARCHY_LEVELS")
                    }
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for ProducerInstanceLocation {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for ProducerInstanceLocation {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for ProducerInstanceLocation {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::CustomResourceHierarchyLevels,
                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for ProducerInstanceLocation {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "PRODUCER_INSTANCE_LOCATION_UNSPECIFIED" => Self::Unspecified,
                    "CUSTOM_RESOURCE_HIERARCHY_LEVELS" => Self::CustomResourceHierarchyLevels,
                    _ => Self::UnknownValue(producer_instance_location::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for ProducerInstanceLocation {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::CustomResourceHierarchyLevels => serializer.serialize_i32(1),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for ProducerInstanceLocation {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProducerInstanceLocation>::new(
                    ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConfig.ProducerInstanceLocation"))
            }
        }
    }

    /// Information about a specific Private Service Connect connection.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct PscConnection {
        /// State of the PSC Connection
        pub state: crate::model::service_connection_policy::State,

        /// The resource reference of the PSC Forwarding Rule within the consumer
        /// VPC.
        pub consumer_forwarding_rule: std::string::String,

        /// The resource reference of the consumer address.
        pub consumer_address: std::string::String,

        /// The error type indicates whether the error is consumer facing, producer
        /// facing or system internal.
        #[deprecated]
        pub error_type: crate::model::ConnectionErrorType,

        /// The most recent error during operating this connection.
        /// Deprecated, please use error_info instead.
        #[deprecated]
        pub error: std::option::Option<rpc::model::Status>,

        /// The last Compute Engine operation to setup PSC connection.
        pub gce_operation: std::string::String,

        /// The project where the PSC connection is created.
        pub consumer_target_project: std::string::String,

        /// The PSC connection id of the PSC forwarding rule.
        pub psc_connection_id: std::string::String,

        /// Output only. The error info for the latest error during operating this
        /// connection.
        pub error_info: std::option::Option<rpc::model::ErrorInfo>,

        /// Output only. The URI of the subnetwork selected to allocate IP address
        /// for this connection.
        pub selected_subnetwork: std::string::String,

        /// Immutable. Deprecated. Use producer_instance_metadata instead.
        /// An immutable identifier for the producer instance.
        #[deprecated]
        pub producer_instance_id: std::string::String,

        /// Immutable. An immutable map for the producer instance metadata.
        pub producer_instance_metadata:
            std::collections::HashMap<std::string::String, std::string::String>,

        /// Output only. [Output only] The service class associated with this PSC
        /// Connection. The value is derived from the SCPolicy and matches the
        /// service class name provided by the customer.
        pub service_class: std::string::String,

        /// The requested IP version for the PSC connection.
        pub ip_version: std::option::Option<crate::model::IPVersion>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl PscConnection {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [state][crate::model::service_connection_policy::PscConnection::state].
        pub fn set_state<T: std::convert::Into<crate::model::service_connection_policy::State>>(
            mut self,
            v: T,
        ) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [consumer_forwarding_rule][crate::model::service_connection_policy::PscConnection::consumer_forwarding_rule].
        pub fn set_consumer_forwarding_rule<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.consumer_forwarding_rule = v.into();
            self
        }

        /// Sets the value of [consumer_address][crate::model::service_connection_policy::PscConnection::consumer_address].
        pub fn set_consumer_address<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.consumer_address = v.into();
            self
        }

        /// Sets the value of [error_type][crate::model::service_connection_policy::PscConnection::error_type].
        #[deprecated]
        pub fn set_error_type<T: std::convert::Into<crate::model::ConnectionErrorType>>(
            mut self,
            v: T,
        ) -> Self {
            self.error_type = v.into();
            self
        }

        /// Sets the value of [error][crate::model::service_connection_policy::PscConnection::error].
        #[deprecated]
        pub fn set_error<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<rpc::model::Status>,
        {
            self.error = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [error][crate::model::service_connection_policy::PscConnection::error].
        #[deprecated]
        pub fn set_or_clear_error<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<rpc::model::Status>,
        {
            self.error = v.map(|x| x.into());
            self
        }

        /// Sets the value of [gce_operation][crate::model::service_connection_policy::PscConnection::gce_operation].
        pub fn set_gce_operation<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.gce_operation = v.into();
            self
        }

        /// Sets the value of [consumer_target_project][crate::model::service_connection_policy::PscConnection::consumer_target_project].
        pub fn set_consumer_target_project<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.consumer_target_project = v.into();
            self
        }

        /// Sets the value of [psc_connection_id][crate::model::service_connection_policy::PscConnection::psc_connection_id].
        pub fn set_psc_connection_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.psc_connection_id = v.into();
            self
        }

        /// Sets the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
        pub fn set_error_info<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<rpc::model::ErrorInfo>,
        {
            self.error_info = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [error_info][crate::model::service_connection_policy::PscConnection::error_info].
        pub fn set_or_clear_error_info<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<rpc::model::ErrorInfo>,
        {
            self.error_info = v.map(|x| x.into());
            self
        }

        /// Sets the value of [selected_subnetwork][crate::model::service_connection_policy::PscConnection::selected_subnetwork].
        pub fn set_selected_subnetwork<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.selected_subnetwork = v.into();
            self
        }

        /// Sets the value of [producer_instance_id][crate::model::service_connection_policy::PscConnection::producer_instance_id].
        #[deprecated]
        pub fn set_producer_instance_id<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.producer_instance_id = v.into();
            self
        }

        /// Sets the value of [producer_instance_metadata][crate::model::service_connection_policy::PscConnection::producer_instance_metadata].
        pub fn set_producer_instance_metadata<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.producer_instance_metadata =
                v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }

        /// Sets the value of [service_class][crate::model::service_connection_policy::PscConnection::service_class].
        pub fn set_service_class<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.service_class = v.into();
            self
        }

        /// Sets the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
        pub fn set_ip_version<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::IPVersion>,
        {
            self.ip_version = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [ip_version][crate::model::service_connection_policy::PscConnection::ip_version].
        pub fn set_or_clear_ip_version<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::IPVersion>,
        {
            self.ip_version = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for PscConnection {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.PscConnection"
        }
    }

    /// The state of the PSC connection.
    /// We reserve the right to add more states without notice in the future.
    /// Users should not use exhaustive switch statements on this enum.
    /// See <https://google.aip.dev/216>.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum State {
        /// An invalid state as the default case.
        Unspecified,
        /// The connection has been created successfully. However, for the
        /// up-to-date connection status, please use the created forwarding rule's
        /// "PscConnectionStatus" as the source of truth.
        Active,
        /// The connection is not functional since some resources on the connection
        /// fail to be created.
        Failed,
        /// The connection is being created.
        Creating,
        /// The connection is being deleted.
        Deleting,
        /// The connection is being repaired to complete creation.
        CreateRepairing,
        /// The connection is being repaired to complete deletion.
        DeleteRepairing,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [State::value] or
        /// [State::name].
        UnknownValue(state::UnknownValue),
    }

    #[doc(hidden)]
    pub mod state {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl State {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Active => std::option::Option::Some(1),
                Self::Failed => std::option::Option::Some(2),
                Self::Creating => std::option::Option::Some(3),
                Self::Deleting => std::option::Option::Some(4),
                Self::CreateRepairing => std::option::Option::Some(5),
                Self::DeleteRepairing => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                Self::Active => std::option::Option::Some("ACTIVE"),
                Self::Failed => std::option::Option::Some("FAILED"),
                Self::Creating => std::option::Option::Some("CREATING"),
                Self::Deleting => std::option::Option::Some("DELETING"),
                Self::CreateRepairing => std::option::Option::Some("CREATE_REPAIRING"),
                Self::DeleteRepairing => std::option::Option::Some("DELETE_REPAIRING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for State {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for State {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for State {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Active,
                2 => Self::Failed,
                3 => Self::Creating,
                4 => Self::Deleting,
                5 => Self::CreateRepairing,
                6 => Self::DeleteRepairing,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for State {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "STATE_UNSPECIFIED" => Self::Unspecified,
                "ACTIVE" => Self::Active,
                "FAILED" => Self::Failed,
                "CREATING" => Self::Creating,
                "DELETING" => Self::Deleting,
                "CREATE_REPAIRING" => Self::CreateRepairing,
                "DELETE_REPAIRING" => Self::DeleteRepairing,
                _ => Self::UnknownValue(state::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for State {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Active => serializer.serialize_i32(1),
                Self::Failed => serializer.serialize_i32(2),
                Self::Creating => serializer.serialize_i32(3),
                Self::Deleting => serializer.serialize_i32(4),
                Self::CreateRepairing => serializer.serialize_i32(5),
                Self::DeleteRepairing => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for State {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                ".google.cloud.networkconnectivity.v1.ServiceConnectionPolicy.State",
            ))
        }
    }
}

/// Request for ListServiceConnectionPolicies.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionPoliciesRequest {
    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
    pub parent: std::string::String,

    /// The maximum number of results per page that should be returned.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// A filter expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceConnectionPoliciesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListServiceConnectionPoliciesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListServiceConnectionPoliciesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListServiceConnectionPoliciesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListServiceConnectionPoliciesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListServiceConnectionPoliciesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListServiceConnectionPoliciesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesRequest"
    }
}

/// Response for ListServiceConnectionPolicies.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionPoliciesResponse {
    /// ServiceConnectionPolicies to be returned.
    pub service_connection_policies: std::vec::Vec<crate::model::ServiceConnectionPolicy>,

    /// The next pagination token in the List response. It should be used as
    /// page_token for the following request. An empty value means no more result.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceConnectionPoliciesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service_connection_policies][crate::model::ListServiceConnectionPoliciesResponse::service_connection_policies].
    pub fn set_service_connection_policies<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ServiceConnectionPolicy>,
    {
        use std::iter::Iterator;
        self.service_connection_policies = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionPoliciesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListServiceConnectionPoliciesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListServiceConnectionPoliciesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionPoliciesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListServiceConnectionPoliciesResponse {
    type PageItem = crate::model::ServiceConnectionPolicy;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.service_connection_policies
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for GetServiceConnectionPolicy.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceConnectionPolicyRequest {
    /// Required. Name of the ServiceConnectionPolicy to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetServiceConnectionPolicyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetServiceConnectionPolicyRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetServiceConnectionPolicyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionPolicyRequest"
    }
}

/// Request for CreateServiceConnectionPolicy.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceConnectionPolicyRequest {
    /// Required. The parent resource's name of the ServiceConnectionPolicy. ex.
    /// projects/123/locations/us-east1
    pub parent: std::string::String,

    /// Optional. Resource ID
    /// (i.e. 'foo' in
    /// '[...]/projects/p/locations/l/serviceConnectionPolicies/foo') See
    /// <https://google.aip.dev/122#resource-id-segments> Unique per location.
    pub service_connection_policy_id: std::string::String,

    /// Required. Initial values for a new ServiceConnectionPolicies
    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateServiceConnectionPolicyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateServiceConnectionPolicyRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [service_connection_policy_id][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy_id].
    pub fn set_service_connection_policy_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.service_connection_policy_id = v.into();
        self
    }

    /// Sets the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
    pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
    {
        self.service_connection_policy = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_connection_policy][crate::model::CreateServiceConnectionPolicyRequest::service_connection_policy].
    pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
    {
        self.service_connection_policy = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateServiceConnectionPolicyRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateServiceConnectionPolicyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionPolicyRequest"
    }
}

/// Request for UpdateServiceConnectionPolicy.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceConnectionPolicyRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// ServiceConnectionPolicy resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. New values to be patched into the resource.
    pub service_connection_policy: std::option::Option<crate::model::ServiceConnectionPolicy>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateServiceConnectionPolicyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceConnectionPolicyRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
    pub fn set_service_connection_policy<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
    {
        self.service_connection_policy = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_connection_policy][crate::model::UpdateServiceConnectionPolicyRequest::service_connection_policy].
    pub fn set_or_clear_service_connection_policy<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionPolicy>,
    {
        self.service_connection_policy = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateServiceConnectionPolicyRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateServiceConnectionPolicyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceConnectionPolicyRequest"
    }
}

/// Request for DeleteServiceConnectionPolicy.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceConnectionPolicyRequest {
    /// Required. The name of the ServiceConnectionPolicy to delete.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteServiceConnectionPolicyRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteServiceConnectionPolicyRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionPolicyRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionPolicyRequest::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DeleteServiceConnectionPolicyRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionPolicyRequest"
    }
}

/// The ServiceClass resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceClass {
    /// Immutable. The name of a ServiceClass resource.
    /// Format:
    /// projects/{project}/locations/{location}/serviceClasses/{service_class}
    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
    pub name: std::string::String,

    /// Output only. The generated service class name. Use this name to refer to
    /// the Service class in Service Connection Maps and Service Connection
    /// Policies.
    pub service_class: std::string::String,

    /// Output only. Time when the ServiceClass was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when the ServiceClass was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// A description of this resource.
    pub description: std::string::String,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceClass {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ServiceClass::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [service_class][crate::model::ServiceClass::service_class].
    pub fn set_service_class<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.service_class = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ServiceClass::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ServiceClass::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ServiceClass::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ServiceClass::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::ServiceClass::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::ServiceClass::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::ServiceClass::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::ServiceClass::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ServiceClass {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceClass"
    }
}

/// Request for ListServiceClasses.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceClassesRequest {
    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
    pub parent: std::string::String,

    /// The maximum number of results per page that should be returned.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// A filter expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceClassesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListServiceClassesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListServiceClassesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListServiceClassesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListServiceClassesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListServiceClassesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListServiceClassesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesRequest"
    }
}

/// Response for ListServiceClasses.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceClassesResponse {
    /// ServiceClasses to be returned.
    pub service_classes: std::vec::Vec<crate::model::ServiceClass>,

    /// The next pagination token in the List response. It should be used as
    /// page_token for the following request. An empty value means no more result.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceClassesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service_classes][crate::model::ListServiceClassesResponse::service_classes].
    pub fn set_service_classes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ServiceClass>,
    {
        use std::iter::Iterator;
        self.service_classes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListServiceClassesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListServiceClassesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListServiceClassesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceClassesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListServiceClassesResponse {
    type PageItem = crate::model::ServiceClass;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.service_classes
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for GetServiceClass.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceClassRequest {
    /// Required. Name of the ServiceClass to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetServiceClassRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetServiceClassRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetServiceClassRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceClassRequest"
    }
}

/// Request for UpdateServiceClass.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateServiceClassRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// ServiceClass resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. New values to be patched into the resource.
    pub service_class: std::option::Option<crate::model::ServiceClass>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateServiceClassRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateServiceClassRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
    pub fn set_service_class<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceClass>,
    {
        self.service_class = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_class][crate::model::UpdateServiceClassRequest::service_class].
    pub fn set_or_clear_service_class<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceClass>,
    {
        self.service_class = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateServiceClassRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateServiceClassRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateServiceClassRequest"
    }
}

/// Request for DeleteServiceClass.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceClassRequest {
    /// Required. The name of the ServiceClass to delete.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteServiceClassRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteServiceClassRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteServiceClassRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteServiceClassRequest::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::DeleteServiceClassRequest::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DeleteServiceClassRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceClassRequest"
    }
}

/// The ServiceConnectionToken resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConnectionToken {
    /// Immutable. The name of a ServiceConnectionToken.
    /// Format:
    /// projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token}
    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
    pub name: std::string::String,

    /// Output only. Time when the ServiceConnectionToken was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when the ServiceConnectionToken was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// A description of this resource.
    pub description: std::string::String,

    /// The resource path of the network associated with this token.
    /// Example:
    /// projects/{projectNumOrId}/global/networks/{resourceId}.
    pub network: std::string::String,

    /// Output only. The token generated by Automation.
    pub token: std::string::String,

    /// Output only. The time to which this token is valid.
    pub expire_time: std::option::Option<wkt::Timestamp>,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceConnectionToken {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ServiceConnectionToken::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ServiceConnectionToken::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ServiceConnectionToken::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ServiceConnectionToken::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ServiceConnectionToken::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::ServiceConnectionToken::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::ServiceConnectionToken::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [network][crate::model::ServiceConnectionToken::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [token][crate::model::ServiceConnectionToken::token].
    pub fn set_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.token = v.into();
        self
    }

    /// Sets the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
    pub fn set_expire_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.expire_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [expire_time][crate::model::ServiceConnectionToken::expire_time].
    pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.expire_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [etag][crate::model::ServiceConnectionToken::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::ServiceConnectionToken::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ServiceConnectionToken {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConnectionToken"
    }
}

/// Request for ListServiceConnectionTokens.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionTokensRequest {
    /// Required. The parent resource's name. ex. projects/123/locations/us-east1
    pub parent: std::string::String,

    /// The maximum number of results per page that should be returned.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// A filter expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceConnectionTokensRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListServiceConnectionTokensRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListServiceConnectionTokensRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListServiceConnectionTokensRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListServiceConnectionTokensRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListServiceConnectionTokensRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListServiceConnectionTokensRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensRequest"
    }
}

/// Response for ListServiceConnectionTokens.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceConnectionTokensResponse {
    /// ServiceConnectionTokens to be returned.
    pub service_connection_tokens: std::vec::Vec<crate::model::ServiceConnectionToken>,

    /// The next pagination token in the List response. It should be used as
    /// page_token for the following request. An empty value means no more result.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListServiceConnectionTokensResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [service_connection_tokens][crate::model::ListServiceConnectionTokensResponse::service_connection_tokens].
    pub fn set_service_connection_tokens<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ServiceConnectionToken>,
    {
        use std::iter::Iterator;
        self.service_connection_tokens = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListServiceConnectionTokensResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListServiceConnectionTokensResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListServiceConnectionTokensResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListServiceConnectionTokensResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListServiceConnectionTokensResponse {
    type PageItem = crate::model::ServiceConnectionToken;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.service_connection_tokens
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for GetServiceConnectionToken.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceConnectionTokenRequest {
    /// Required. Name of the ServiceConnectionToken to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetServiceConnectionTokenRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetServiceConnectionTokenRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetServiceConnectionTokenRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetServiceConnectionTokenRequest"
    }
}

/// Request for CreateServiceConnectionToken.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceConnectionTokenRequest {
    /// Required. The parent resource's name of the ServiceConnectionToken. ex.
    /// projects/123/locations/us-east1
    pub parent: std::string::String,

    /// Optional. Resource ID
    /// (i.e. 'foo' in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo')
    /// See <https://google.aip.dev/122#resource-id-segments>
    /// Unique per location.
    /// If one is not provided, one will be generated.
    pub service_connection_token_id: std::string::String,

    /// Required. Initial values for a new ServiceConnectionTokens
    pub service_connection_token: std::option::Option<crate::model::ServiceConnectionToken>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateServiceConnectionTokenRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateServiceConnectionTokenRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [service_connection_token_id][crate::model::CreateServiceConnectionTokenRequest::service_connection_token_id].
    pub fn set_service_connection_token_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.service_connection_token_id = v.into();
        self
    }

    /// Sets the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
    pub fn set_service_connection_token<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionToken>,
    {
        self.service_connection_token = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [service_connection_token][crate::model::CreateServiceConnectionTokenRequest::service_connection_token].
    pub fn set_or_clear_service_connection_token<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ServiceConnectionToken>,
    {
        self.service_connection_token = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateServiceConnectionTokenRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateServiceConnectionTokenRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateServiceConnectionTokenRequest"
    }
}

/// Request for DeleteServiceConnectionToken.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceConnectionTokenRequest {
    /// Required. The name of the ServiceConnectionToken to delete.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. The etag is computed by the server, and may be sent on update and
    /// delete requests to ensure the client has an up-to-date value before
    /// proceeding.
    pub etag: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteServiceConnectionTokenRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteServiceConnectionTokenRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteServiceConnectionTokenRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
    pub fn set_etag<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [etag][crate::model::DeleteServiceConnectionTokenRequest::etag].
    pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.etag = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for DeleteServiceConnectionTokenRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteServiceConnectionTokenRequest"
    }
}

/// The `MulticloudDataTransferConfig` resource. It lists the services that you
/// configure for Data Transfer Essentials billing and metering.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MulticloudDataTransferConfig {
    /// Identifier. The name of the `MulticloudDataTransferConfig` resource.
    /// Format:
    /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}`.
    pub name: std::string::String,

    /// Output only. Time when the `MulticloudDataTransferConfig` resource was
    /// created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when the `MulticloudDataTransferConfig` resource was
    /// updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// The etag is computed by the server, and might be sent with update and
    /// delete requests so that the client has an up-to-date value before
    /// proceeding.
    pub etag: std::string::String,

    /// Optional. A description of this resource.
    pub description: std::string::String,

    /// Output only. The number of `Destination` resources configured for the
    /// `MulticloudDataTransferConfig` resource.
    pub destinations_count: i32,

    /// Output only. The number of `Destination` resources in use with the
    /// `MulticloudDataTransferConfig` resource.
    pub destinations_active_count: i32,

    /// Optional. Maps services to their current or planned states. Service names
    /// are keys, and the associated values describe the state of the service. If a
    /// state change is expected, the value is either `ADDING` or `DELETING`,
    /// depending on the actions taken.
    ///
    /// Sample output:
    /// "services": {
    /// "big-query": {
    /// "states": [
    /// {
    /// "effectiveTime": "2024-12-12T08:00:00Z"
    /// "state": "ADDING",
    /// },
    /// ]
    /// },
    /// "cloud-storage": {
    /// "states": [
    /// {
    /// "state": "ACTIVE",
    /// }
    /// ]
    /// }
    /// }
    pub services: std::collections::HashMap<std::string::String, crate::model::StateTimeline>,

    /// Output only. The Google-generated unique ID for the
    /// `MulticloudDataTransferConfig` resource. This value is unique across all
    /// `MulticloudDataTransferConfig` resources. If a resource is deleted and
    /// another with the same name is created, the new resource is assigned a
    /// different and unique ID.
    pub uid: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MulticloudDataTransferConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::MulticloudDataTransferConfig::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::MulticloudDataTransferConfig::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::MulticloudDataTransferConfig::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::MulticloudDataTransferConfig::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [etag][crate::model::MulticloudDataTransferConfig::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [description][crate::model::MulticloudDataTransferConfig::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [destinations_count][crate::model::MulticloudDataTransferConfig::destinations_count].
    pub fn set_destinations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.destinations_count = v.into();
        self
    }

    /// Sets the value of [destinations_active_count][crate::model::MulticloudDataTransferConfig::destinations_active_count].
    pub fn set_destinations_active_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.destinations_active_count = v.into();
        self
    }

    /// Sets the value of [services][crate::model::MulticloudDataTransferConfig::services].
    pub fn set_services<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<crate::model::StateTimeline>,
    {
        use std::iter::Iterator;
        self.services = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [uid][crate::model::MulticloudDataTransferConfig::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }
}

impl wkt::message::Message for MulticloudDataTransferConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferConfig"
    }
}

/// Request message to list `MulticloudDataTransferConfig` resources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferConfigsRequest {
    /// Required. The name of the parent resource.
    pub parent: std::string::String,

    /// Optional. The maximum number of results listed per page.
    pub page_size: i32,

    /// Optional. The page token.
    pub page_token: std::string::String,

    /// Optional. An expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Optional. The sort order of the results.
    pub order_by: std::string::String,

    /// Optional. If `true`, allows partial responses for multi-regional aggregated
    /// list requests.
    pub return_partial_success: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMulticloudDataTransferConfigsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListMulticloudDataTransferConfigsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferConfigsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferConfigsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListMulticloudDataTransferConfigsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListMulticloudDataTransferConfigsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [return_partial_success][crate::model::ListMulticloudDataTransferConfigsRequest::return_partial_success].
    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.return_partial_success = v.into();
        self
    }
}

impl wkt::message::Message for ListMulticloudDataTransferConfigsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsRequest"
    }
}

/// Response message to list `MulticloudDataTransferConfig` resources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferConfigsResponse {
    /// The list of `MulticloudDataTransferConfig` resources to be listed.
    pub multicloud_data_transfer_configs: std::vec::Vec<crate::model::MulticloudDataTransferConfig>,

    /// The next page token.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMulticloudDataTransferConfigsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [multicloud_data_transfer_configs][crate::model::ListMulticloudDataTransferConfigsResponse::multicloud_data_transfer_configs].
    pub fn set_multicloud_data_transfer_configs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
    {
        use std::iter::Iterator;
        self.multicloud_data_transfer_configs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferConfigsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListMulticloudDataTransferConfigsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListMulticloudDataTransferConfigsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferConfigsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListMulticloudDataTransferConfigsResponse {
    type PageItem = crate::model::MulticloudDataTransferConfig;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.multicloud_data_transfer_configs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message to get the details of a `MulticloudDataTransferConfig`
/// resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMulticloudDataTransferConfigRequest {
    /// Required. The name of the `MulticloudDataTransferConfig` resource to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetMulticloudDataTransferConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetMulticloudDataTransferConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetMulticloudDataTransferConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferConfigRequest"
    }
}

/// Request message to create a `MulticloudDataTransferConfig` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMulticloudDataTransferConfigRequest {
    /// Required. The name of the parent resource.
    pub parent: std::string::String,

    /// Required. The ID to use for the `MulticloudDataTransferConfig` resource,
    /// which becomes the final component of the `MulticloudDataTransferConfig`
    /// resource name.
    pub multicloud_data_transfer_config_id: std::string::String,

    /// Required. The `MulticloudDataTransferConfig` resource to create.
    pub multicloud_data_transfer_config:
        std::option::Option<crate::model::MulticloudDataTransferConfig>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server can ignore
    /// the request if it has already been completed. The server waits
    /// for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, can ignore the second request. This prevents
    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
    /// resources.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID
    /// (00000000-0000-0000-0000-000000000000) isn't supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateMulticloudDataTransferConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateMulticloudDataTransferConfigRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [multicloud_data_transfer_config_id][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config_id].
    pub fn set_multicloud_data_transfer_config_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.multicloud_data_transfer_config_id = v.into();
        self
    }

    /// Sets the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
    pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
    {
        self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::CreateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
    pub fn set_or_clear_multicloud_data_transfer_config<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
    {
        self.multicloud_data_transfer_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateMulticloudDataTransferConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateMulticloudDataTransferConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateMulticloudDataTransferConfigRequest"
    }
}

/// Request message to update a `MulticloudDataTransferConfig` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMulticloudDataTransferConfigRequest {
    /// Optional. `FieldMask` is used to specify the fields in the
    /// `MulticloudDataTransferConfig` resource to be overwritten by the update.
    /// The fields specified in `update_mask` are relative to the resource, not
    /// the full request. A field is overwritten if it is in the mask. If you
    /// don't specify a mask, all fields are overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The `MulticloudDataTransferConfig` resource to update.
    pub multicloud_data_transfer_config:
        std::option::Option<crate::model::MulticloudDataTransferConfig>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server can ignore
    /// the request if it has already been completed. The server waits
    /// for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, can ignore the second request. This prevents
    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
    /// resources.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID
    /// (00000000-0000-0000-0000-000000000000) isn't supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateMulticloudDataTransferConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateMulticloudDataTransferConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
    pub fn set_multicloud_data_transfer_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
    {
        self.multicloud_data_transfer_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [multicloud_data_transfer_config][crate::model::UpdateMulticloudDataTransferConfigRequest::multicloud_data_transfer_config].
    pub fn set_or_clear_multicloud_data_transfer_config<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::MulticloudDataTransferConfig>,
    {
        self.multicloud_data_transfer_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateMulticloudDataTransferConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateMulticloudDataTransferConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateMulticloudDataTransferConfigRequest"
    }
}

/// Request message to delete a `MulticloudDataTransferConfig` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMulticloudDataTransferConfigRequest {
    /// Required. The name of the `MulticloudDataTransferConfig` resource to
    /// delete.
    pub name: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server can ignore
    /// the request if it has already been completed. The server waits
    /// for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, can ignore the second request. This prevents
    /// clients from accidentally creating duplicate `MulticloudDataTransferConfig`
    /// resources.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID
    /// (00000000-0000-0000-0000-000000000000) isn't supported.
    pub request_id: std::string::String,

    /// Optional. The etag is computed by the server, and might be sent with update
    /// and delete requests so that the client has an up-to-date value before
    /// proceeding.
    pub etag: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteMulticloudDataTransferConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteMulticloudDataTransferConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteMulticloudDataTransferConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteMulticloudDataTransferConfigRequest::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }
}

impl wkt::message::Message for DeleteMulticloudDataTransferConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteMulticloudDataTransferConfigRequest"
    }
}

/// The `Destination` resource. It specifies the IP prefix and the associated
/// autonomous system numbers (ASN) that you want to include in a
/// `MulticloudDataTransferConfig` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Destination {
    /// Identifier. The name of the `Destination` resource.
    /// Format:
    /// `projects/{project}/locations/{location}/multicloudDataTransferConfigs/{multicloud_data_transfer_config}/destinations/{destination}`.
    pub name: std::string::String,

    /// Output only. Time when the `Destination` resource was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when the `Destination` resource was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// The etag is computed by the server, and might be sent with update and
    /// delete requests so that the client has an up-to-date value before
    /// proceeding.
    pub etag: std::string::String,

    /// Optional. A description of this resource.
    pub description: std::string::String,

    /// Required. Immutable. The IP prefix that represents your workload on another
    /// CSP.
    pub ip_prefix: std::string::String,

    /// Required. Unordered list. The list of `DestinationEndpoint` resources
    /// configured for the IP prefix.
    pub endpoints: std::vec::Vec<crate::model::destination::DestinationEndpoint>,

    /// Output only. The timeline of the expected `Destination` states or the
    /// current rest state. If a state change is expected, the value is `ADDING`,
    /// `DELETING` or `SUSPENDING`, depending on the action specified.
    ///
    /// Example:
    /// "state_timeline": {
    /// "states": [
    /// {
    /// // The time when the `Destination` resource will be activated.
    /// "effectiveTime": "2024-12-01T08:00:00Z",
    /// "state": "ADDING"
    /// },
    /// {
    /// // The time when the `Destination` resource will be suspended.
    /// "effectiveTime": "2024-12-01T20:00:00Z",
    /// "state": "SUSPENDING"
    /// }
    /// ]
    /// }
    pub state_timeline: std::option::Option<crate::model::StateTimeline>,

    /// Output only. The Google-generated unique ID for the `Destination` resource.
    /// This value is unique across all `Destination` resources.
    /// If a resource is deleted and another with the same name is
    /// created, the new resource is assigned a different and unique ID.
    pub uid: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Destination {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Destination::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Destination::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Destination::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Destination::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Destination::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Destination::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [etag][crate::model::Destination::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [description][crate::model::Destination::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [ip_prefix][crate::model::Destination::ip_prefix].
    pub fn set_ip_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.ip_prefix = v.into();
        self
    }

    /// Sets the value of [endpoints][crate::model::Destination::endpoints].
    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::destination::DestinationEndpoint>,
    {
        use std::iter::Iterator;
        self.endpoints = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [state_timeline][crate::model::Destination::state_timeline].
    pub fn set_state_timeline<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::StateTimeline>,
    {
        self.state_timeline = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [state_timeline][crate::model::Destination::state_timeline].
    pub fn set_or_clear_state_timeline<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::StateTimeline>,
    {
        self.state_timeline = v.map(|x| x.into());
        self
    }

    /// Sets the value of [uid][crate::model::Destination::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }
}

impl wkt::message::Message for Destination {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination"
    }
}

/// Defines additional types related to [Destination].
pub mod destination {
    #[allow(unused_imports)]
    use super::*;

    /// The metadata for a `DestinationEndpoint` resource.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct DestinationEndpoint {
        /// Required. The ASN of the remote IP prefix.
        pub asn: i64,

        /// Required. The CSP of the remote IP prefix.
        pub csp: std::string::String,

        /// Output only. The state of the `DestinationEndpoint` resource.
        pub state: crate::model::destination::destination_endpoint::State,

        /// Output only. Time when the `DestinationEndpoint` resource was updated.
        pub update_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl DestinationEndpoint {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [asn][crate::model::destination::DestinationEndpoint::asn].
        pub fn set_asn<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.asn = v.into();
            self
        }

        /// Sets the value of [csp][crate::model::destination::DestinationEndpoint::csp].
        pub fn set_csp<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.csp = v.into();
            self
        }

        /// Sets the value of [state][crate::model::destination::DestinationEndpoint::state].
        pub fn set_state<
            T: std::convert::Into<crate::model::destination::destination_endpoint::State>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
        pub fn set_update_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.update_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [update_time][crate::model::destination::DestinationEndpoint::update_time].
        pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.update_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for DestinationEndpoint {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint"
        }
    }

    /// Defines additional types related to [DestinationEndpoint].
    pub mod destination_endpoint {
        #[allow(unused_imports)]
        use super::*;

        /// The state of the `DestinationEndpoint` resource.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum State {
            /// An invalid state, which is the default case.
            Unspecified,
            /// The `DestinationEndpoint` resource is valid.
            Valid,
            /// The `DestinationEndpoint` resource is invalid.
            Invalid,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [State::value] or
            /// [State::name].
            UnknownValue(state::UnknownValue),
        }

        #[doc(hidden)]
        pub mod state {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl State {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Valid => std::option::Option::Some(1),
                    Self::Invalid => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                    Self::Valid => std::option::Option::Some("VALID"),
                    Self::Invalid => std::option::Option::Some("INVALID"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for State {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for State {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for State {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Valid,
                    2 => Self::Invalid,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for State {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "STATE_UNSPECIFIED" => Self::Unspecified,
                    "VALID" => Self::Valid,
                    "INVALID" => Self::Invalid,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for State {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Valid => serializer.serialize_i32(1),
                    Self::Invalid => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for State {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                    ".google.cloud.networkconnectivity.v1.Destination.DestinationEndpoint.State",
                ))
            }
        }
    }
}

/// Request message to list `Destination` resources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDestinationsRequest {
    /// Required. The name of the parent resource.
    pub parent: std::string::String,

    /// Optional. The maximum number of results listed per page.
    pub page_size: i32,

    /// Optional. The page token.
    pub page_token: std::string::String,

    /// Optional. An expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Optional. The sort order of the results.
    pub order_by: std::string::String,

    /// Optional. If `true`, allow partial responses for multi-regional aggregated
    /// list requests.
    pub return_partial_success: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDestinationsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListDestinationsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListDestinationsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListDestinationsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListDestinationsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListDestinationsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [return_partial_success][crate::model::ListDestinationsRequest::return_partial_success].
    pub fn set_return_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.return_partial_success = v.into();
        self
    }
}

impl wkt::message::Message for ListDestinationsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsRequest"
    }
}

/// Response message to list `Destination` resources.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDestinationsResponse {
    /// The list of `Destination` resources to be listed.
    pub destinations: std::vec::Vec<crate::model::Destination>,

    /// The next page token.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListDestinationsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [destinations][crate::model::ListDestinationsResponse::destinations].
    pub fn set_destinations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Destination>,
    {
        use std::iter::Iterator;
        self.destinations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListDestinationsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListDestinationsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListDestinationsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListDestinationsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListDestinationsResponse {
    type PageItem = crate::model::Destination;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.destinations
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message to get the details of a `Destination` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDestinationRequest {
    /// Required. The name of the `Destination` resource to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetDestinationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetDestinationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetDestinationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetDestinationRequest"
    }
}

/// Request message to create a `Destination` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDestinationRequest {
    /// Required. The name of the parent resource.
    pub parent: std::string::String,

    /// Required. The ID to use for the `Destination` resource, which becomes the
    /// final component of the `Destination` resource name.
    pub destination_id: std::string::String,

    /// Required. The `Destination` resource to create.
    pub destination: std::option::Option<crate::model::Destination>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server can ignore
    /// the request if it has already been completed. The server waits
    /// for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, can ignore the second request. This prevents
    /// clients from accidentally creating duplicate `Destination`
    /// resources.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID
    /// (00000000-0000-0000-0000-000000000000) isn't supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateDestinationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateDestinationRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [destination_id][crate::model::CreateDestinationRequest::destination_id].
    pub fn set_destination_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.destination_id = v.into();
        self
    }

    /// Sets the value of [destination][crate::model::CreateDestinationRequest::destination].
    pub fn set_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Destination>,
    {
        self.destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [destination][crate::model::CreateDestinationRequest::destination].
    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Destination>,
    {
        self.destination = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateDestinationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateDestinationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateDestinationRequest"
    }
}

/// Request message to update a `Destination` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDestinationRequest {
    /// Optional. `FieldMask is used to specify the fields to be overwritten in the
    /// `Destination` resource by the update.
    /// The fields specified in `update_mask` are relative to the resource, not
    /// the full request. A field is overwritten if it is in the mask. If you
    /// don't specify a mask, all fields are overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The `Destination` resource to update.
    pub destination: std::option::Option<crate::model::Destination>,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server can ignore
    /// the request if it has already been completed. The server waits
    /// for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, can ignore the second request.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID
    /// (00000000-0000-0000-0000-000000000000) isn't supported.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateDestinationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateDestinationRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [destination][crate::model::UpdateDestinationRequest::destination].
    pub fn set_destination<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Destination>,
    {
        self.destination = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [destination][crate::model::UpdateDestinationRequest::destination].
    pub fn set_or_clear_destination<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Destination>,
    {
        self.destination = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateDestinationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateDestinationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateDestinationRequest"
    }
}

/// Request message to delete a `Destination` resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDestinationRequest {
    /// Required. The name of the `Destination` resource to delete.
    pub name: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID
    /// so that if you must retry your request, the server can ignore
    /// the request if it has already been completed. The server waits
    /// for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, can ignore the second request.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID
    /// (00000000-0000-0000-0000-000000000000) isn't supported.
    pub request_id: std::string::String,

    /// Optional. The etag is computed by the server, and might be sent with update
    /// and delete requests so that the client has an up-to-date value before
    /// proceeding.
    pub etag: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteDestinationRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteDestinationRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteDestinationRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::DeleteDestinationRequest::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }
}

impl wkt::message::Message for DeleteDestinationRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteDestinationRequest"
    }
}

/// The timeline of the pending states for a resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StateTimeline {
    /// Output only. The state and activation time details of the resource state.
    pub states: std::vec::Vec<crate::model::state_timeline::StateMetadata>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StateTimeline {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [states][crate::model::StateTimeline::states].
    pub fn set_states<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::state_timeline::StateMetadata>,
    {
        use std::iter::Iterator;
        self.states = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for StateTimeline {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline"
    }
}

/// Defines additional types related to [StateTimeline].
pub mod state_timeline {
    #[allow(unused_imports)]
    use super::*;

    /// The state and activation time details of the resource state.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct StateMetadata {
        /// Output only. The state of the resource.
        pub state: crate::model::state_timeline::state_metadata::State,

        /// Output only. Accompanies only the transient states, which include
        /// `ADDING`, `DELETING`, and `SUSPENDING`, to denote the time until which
        /// the transient state of the resource will be effective. For instance, if
        /// the state is `ADDING`, this field shows the time when the resource state
        /// transitions to `ACTIVE`.
        pub effective_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl StateMetadata {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [state][crate::model::state_timeline::StateMetadata::state].
        pub fn set_state<
            T: std::convert::Into<crate::model::state_timeline::state_metadata::State>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
        pub fn set_effective_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.effective_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [effective_time][crate::model::state_timeline::StateMetadata::effective_time].
        pub fn set_or_clear_effective_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.effective_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for StateMetadata {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata"
        }
    }

    /// Defines additional types related to [StateMetadata].
    pub mod state_metadata {
        #[allow(unused_imports)]
        use super::*;

        /// The state of the resource.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum State {
            /// An invalid state, which is the default case.
            Unspecified,
            /// The resource is being added.
            Adding,
            /// The resource is in use.
            Active,
            /// The resource is being deleted.
            Deleting,
            /// The resource is being suspended.
            Suspending,
            /// The resource is suspended and not in use.
            Suspended,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [State::value] or
            /// [State::name].
            UnknownValue(state::UnknownValue),
        }

        #[doc(hidden)]
        pub mod state {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl State {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Adding => std::option::Option::Some(1),
                    Self::Active => std::option::Option::Some(2),
                    Self::Deleting => std::option::Option::Some(3),
                    Self::Suspending => std::option::Option::Some(4),
                    Self::Suspended => std::option::Option::Some(5),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
                    Self::Adding => std::option::Option::Some("ADDING"),
                    Self::Active => std::option::Option::Some("ACTIVE"),
                    Self::Deleting => std::option::Option::Some("DELETING"),
                    Self::Suspending => std::option::Option::Some("SUSPENDING"),
                    Self::Suspended => std::option::Option::Some("SUSPENDED"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for State {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for State {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for State {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Adding,
                    2 => Self::Active,
                    3 => Self::Deleting,
                    4 => Self::Suspending,
                    5 => Self::Suspended,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for State {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "STATE_UNSPECIFIED" => Self::Unspecified,
                    "ADDING" => Self::Adding,
                    "ACTIVE" => Self::Active,
                    "DELETING" => Self::Deleting,
                    "SUSPENDING" => Self::Suspending,
                    "SUSPENDED" => Self::Suspended,
                    _ => Self::UnknownValue(state::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for State {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Adding => serializer.serialize_i32(1),
                    Self::Active => serializer.serialize_i32(2),
                    Self::Deleting => serializer.serialize_i32(3),
                    Self::Suspending => serializer.serialize_i32(4),
                    Self::Suspended => serializer.serialize_i32(5),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for State {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
                    ".google.cloud.networkconnectivity.v1.StateTimeline.StateMetadata.State",
                ))
            }
        }
    }
}

/// A service in your project in a region that is eligible for Data Transfer
/// Essentials configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MulticloudDataTransferSupportedService {
    /// Identifier. The name of the service.
    pub name: std::string::String,

    /// Output only. The network service tier or regional endpoint supported for
    /// the service.
    pub service_configs: std::vec::Vec<crate::model::ServiceConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl MulticloudDataTransferSupportedService {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::MulticloudDataTransferSupportedService::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [service_configs][crate::model::MulticloudDataTransferSupportedService::service_configs].
    pub fn set_service_configs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ServiceConfig>,
    {
        use std::iter::Iterator;
        self.service_configs = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for MulticloudDataTransferSupportedService {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.MulticloudDataTransferSupportedService"
    }
}

/// Specifies eligibility information for the service.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceConfig {
    /// Output only. The eligibility criteria for the service.
    pub eligibility_criteria: crate::model::service_config::EligibilityCriteria,

    /// Output only. The end time for eligibility criteria support. If not
    /// specified, no planned end time is set.
    pub support_end_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ServiceConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [eligibility_criteria][crate::model::ServiceConfig::eligibility_criteria].
    pub fn set_eligibility_criteria<
        T: std::convert::Into<crate::model::service_config::EligibilityCriteria>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.eligibility_criteria = v.into();
        self
    }

    /// Sets the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
    pub fn set_support_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.support_end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [support_end_time][crate::model::ServiceConfig::support_end_time].
    pub fn set_or_clear_support_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.support_end_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ServiceConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ServiceConfig"
    }
}

/// Defines additional types related to [ServiceConfig].
pub mod service_config {
    #[allow(unused_imports)]
    use super::*;

    /// The eligibility information for the service.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum EligibilityCriteria {
        /// The service is not eligible for Data Transfer Essentials configuration.
        /// This is the default case.
        Unspecified,
        /// The service is eligible for Data Transfer Essentials configuration only
        /// for Premium Tier.
        NetworkServiceTierPremiumOnly,
        /// The service is eligible for Data Transfer Essentials configuration only
        /// for Standard Tier.
        NetworkServiceTierStandardOnly,
        /// The service is eligible for Data Transfer Essentials configuration only
        /// for the regional endpoint.
        RequestEndpointRegionalEndpointOnly,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [EligibilityCriteria::value] or
        /// [EligibilityCriteria::name].
        UnknownValue(eligibility_criteria::UnknownValue),
    }

    #[doc(hidden)]
    pub mod eligibility_criteria {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl EligibilityCriteria {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::NetworkServiceTierPremiumOnly => std::option::Option::Some(1),
                Self::NetworkServiceTierStandardOnly => std::option::Option::Some(2),
                Self::RequestEndpointRegionalEndpointOnly => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("ELIGIBILITY_CRITERIA_UNSPECIFIED"),
                Self::NetworkServiceTierPremiumOnly => {
                    std::option::Option::Some("NETWORK_SERVICE_TIER_PREMIUM_ONLY")
                }
                Self::NetworkServiceTierStandardOnly => {
                    std::option::Option::Some("NETWORK_SERVICE_TIER_STANDARD_ONLY")
                }
                Self::RequestEndpointRegionalEndpointOnly => {
                    std::option::Option::Some("REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY")
                }
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for EligibilityCriteria {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for EligibilityCriteria {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for EligibilityCriteria {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::NetworkServiceTierPremiumOnly,
                2 => Self::NetworkServiceTierStandardOnly,
                3 => Self::RequestEndpointRegionalEndpointOnly,
                _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for EligibilityCriteria {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "ELIGIBILITY_CRITERIA_UNSPECIFIED" => Self::Unspecified,
                "NETWORK_SERVICE_TIER_PREMIUM_ONLY" => Self::NetworkServiceTierPremiumOnly,
                "NETWORK_SERVICE_TIER_STANDARD_ONLY" => Self::NetworkServiceTierStandardOnly,
                "REQUEST_ENDPOINT_REGIONAL_ENDPOINT_ONLY" => {
                    Self::RequestEndpointRegionalEndpointOnly
                }
                _ => Self::UnknownValue(eligibility_criteria::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for EligibilityCriteria {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::NetworkServiceTierPremiumOnly => serializer.serialize_i32(1),
                Self::NetworkServiceTierStandardOnly => serializer.serialize_i32(2),
                Self::RequestEndpointRegionalEndpointOnly => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for EligibilityCriteria {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EligibilityCriteria>::new(
                ".google.cloud.networkconnectivity.v1.ServiceConfig.EligibilityCriteria",
            ))
        }
    }
}

/// Request message to check if a service in your project in a region is
/// eligible for Data Transfer Essentials configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMulticloudDataTransferSupportedServiceRequest {
    /// Required. The name of the service.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetMulticloudDataTransferSupportedServiceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetMulticloudDataTransferSupportedServiceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetMulticloudDataTransferSupportedServiceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetMulticloudDataTransferSupportedServiceRequest"
    }
}

/// Request message to list the services in your project that are eligible for
/// Data Transfer Essentials configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferSupportedServicesRequest {
    /// Required. The name of the parent resource.
    pub parent: std::string::String,

    /// Optional. The maximum number of results listed per page.
    pub page_size: i32,

    /// Optional. The page token.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMulticloudDataTransferSupportedServicesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListMulticloudDataTransferSupportedServicesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListMulticloudDataTransferSupportedServicesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesRequest"
    }
}

/// Response message to list the services in your project in regions that are
/// eligible for Data Transfer Essentials configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMulticloudDataTransferSupportedServicesResponse {
    /// The list of supported services.
    pub multicloud_data_transfer_supported_services:
        std::vec::Vec<crate::model::MulticloudDataTransferSupportedService>,

    /// The next page token.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListMulticloudDataTransferSupportedServicesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [multicloud_data_transfer_supported_services][crate::model::ListMulticloudDataTransferSupportedServicesResponse::multicloud_data_transfer_supported_services].
    pub fn set_multicloud_data_transfer_supported_services<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::MulticloudDataTransferSupportedService>,
    {
        use std::iter::Iterator;
        self.multicloud_data_transfer_supported_services =
            v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListMulticloudDataTransferSupportedServicesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListMulticloudDataTransferSupportedServicesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListMulticloudDataTransferSupportedServicesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse
    for ListMulticloudDataTransferSupportedServicesResponse
{
    type PageItem = crate::model::MulticloudDataTransferSupportedService;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.multicloud_data_transfer_supported_services
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// A Network Connectivity Center hub is a global management resource to which
/// you attach spokes. A single hub can contain spokes from multiple regions.
/// However, if any of a hub's spokes use the site-to-site data transfer feature,
/// the resources associated with those spokes must all be in the same VPC
/// network. Spokes that do not use site-to-site data transfer can be associated
/// with any VPC network in your project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Hub {
    /// Immutable. The name of the hub. Hub names must be unique. They use the
    /// following form:
    /// `projects/{project_number}/locations/global/hubs/{hub_id}`
    pub name: std::string::String,

    /// Output only. The time the hub was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the hub was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional labels in key-value pair format. For more information about
    /// labels, see [Requirements for
    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. An optional description of the hub.
    pub description: std::string::String,

    /// Output only. The Google-generated UUID for the hub. This value is unique
    /// across all hub resources. If a hub is deleted and another with the same
    /// name is created, the new hub is assigned a different unique_id.
    pub unique_id: std::string::String,

    /// Output only. The current lifecycle state of this hub.
    pub state: crate::model::State,

    /// The VPC networks associated with this hub's spokes.
    ///
    /// This field is read-only. Network Connectivity Center automatically
    /// populates it based on the set of spokes attached to the hub.
    pub routing_vpcs: std::vec::Vec<crate::model::RoutingVPC>,

    /// Output only. The route tables that belong to this hub. They use the
    /// following form:
    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
    ///
    /// This field is read-only. Network Connectivity Center automatically
    /// populates it based on the route tables nested under the hub.
    pub route_tables: std::vec::Vec<std::string::String>,

    /// Output only. A summary of the spokes associated with a hub. The
    /// summary includes a count of spokes according to type
    /// and according to state. If any spokes are inactive,
    /// the summary also lists the reasons they are inactive,
    /// including a count for each reason.
    pub spoke_summary: std::option::Option<crate::model::SpokeSummary>,

    /// Optional. The policy mode of this hub. This field can be either
    /// PRESET or CUSTOM. If unspecified, the
    /// policy_mode defaults to PRESET.
    pub policy_mode: crate::model::PolicyMode,

    /// Optional. The topology implemented in this hub. Currently, this field is
    /// only used when policy_mode = PRESET. The available preset topologies are
    /// MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET,
    /// the preset_topology defaults to MESH. When policy_mode = CUSTOM,
    /// the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED.
    pub preset_topology: crate::model::PresetTopology,

    /// Optional. Whether Private Service Connect connection propagation is enabled
    /// for the hub. If true, Private Service Connect endpoints in VPC spokes
    /// attached to the hub are made accessible to other VPC spokes attached to the
    /// hub. The default value is false.
    pub export_psc: std::option::Option<bool>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Hub {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Hub::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Hub::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Hub::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Hub::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Hub::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Hub::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Hub::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [unique_id][crate::model::Hub::unique_id].
    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.unique_id = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Hub::state].
    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [routing_vpcs][crate::model::Hub::routing_vpcs].
    pub fn set_routing_vpcs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::RoutingVPC>,
    {
        use std::iter::Iterator;
        self.routing_vpcs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [route_tables][crate::model::Hub::route_tables].
    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.route_tables = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [spoke_summary][crate::model::Hub::spoke_summary].
    pub fn set_spoke_summary<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::SpokeSummary>,
    {
        self.spoke_summary = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spoke_summary][crate::model::Hub::spoke_summary].
    pub fn set_or_clear_spoke_summary<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::SpokeSummary>,
    {
        self.spoke_summary = v.map(|x| x.into());
        self
    }

    /// Sets the value of [policy_mode][crate::model::Hub::policy_mode].
    pub fn set_policy_mode<T: std::convert::Into<crate::model::PolicyMode>>(
        mut self,
        v: T,
    ) -> Self {
        self.policy_mode = v.into();
        self
    }

    /// Sets the value of [preset_topology][crate::model::Hub::preset_topology].
    pub fn set_preset_topology<T: std::convert::Into<crate::model::PresetTopology>>(
        mut self,
        v: T,
    ) -> Self {
        self.preset_topology = v.into();
        self
    }

    /// Sets the value of [export_psc][crate::model::Hub::export_psc].
    pub fn set_export_psc<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.export_psc = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [export_psc][crate::model::Hub::export_psc].
    pub fn set_or_clear_export_psc<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<bool>,
    {
        self.export_psc = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Hub {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.Hub"
    }
}

/// RoutingVPC contains information about the VPC networks associated
/// with the spokes of a Network Connectivity Center hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RoutingVPC {
    /// The URI of the VPC network.
    pub uri: std::string::String,

    /// Output only. If true, indicates that this VPC network is currently
    /// associated with spokes that use the data transfer feature (spokes where the
    /// site_to_site_data_transfer field is set to true). If you create new spokes
    /// that use data transfer, they must be associated with this VPC network. At
    /// most, one VPC network will have this field set to true.
    pub required_for_new_site_to_site_data_transfer_spokes: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RoutingVPC {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::RoutingVPC::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [required_for_new_site_to_site_data_transfer_spokes][crate::model::RoutingVPC::required_for_new_site_to_site_data_transfer_spokes].
    pub fn set_required_for_new_site_to_site_data_transfer_spokes<T: std::convert::Into<bool>>(
        mut self,
        v: T,
    ) -> Self {
        self.required_for_new_site_to_site_data_transfer_spokes = v.into();
        self
    }
}

impl wkt::message::Message for RoutingVPC {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.RoutingVPC"
    }
}

/// A Network Connectivity Center spoke represents one or more network
/// connectivity resources.
///
/// When you create a spoke, you associate it with a hub. You must also
/// identify a value for exactly one of the following fields:
///
/// * linked_vpn_tunnels
/// * linked_interconnect_attachments
/// * linked_router_appliance_instances
/// * linked_vpc_network
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Spoke {
    /// Immutable. The name of the spoke. Spoke names must be unique. They use the
    /// following form:
    /// `projects/{project_number}/locations/{region}/spokes/{spoke_id}`
    pub name: std::string::String,

    /// Output only. The time the spoke was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the spoke was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional labels in key-value pair format. For more information about
    /// labels, see [Requirements for
    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. An optional description of the spoke.
    pub description: std::string::String,

    /// Immutable. The name of the hub that this spoke is attached to.
    pub hub: std::string::String,

    /// Optional. The name of the group that this spoke is associated with.
    pub group: std::string::String,

    /// Optional. VPN tunnels that are associated with the spoke.
    pub linked_vpn_tunnels: std::option::Option<crate::model::LinkedVpnTunnels>,

    /// Optional. VLAN attachments that are associated with the spoke.
    pub linked_interconnect_attachments:
        std::option::Option<crate::model::LinkedInterconnectAttachments>,

    /// Optional. Router appliance instances that are associated with the spoke.
    pub linked_router_appliance_instances:
        std::option::Option<crate::model::LinkedRouterApplianceInstances>,

    /// Optional. VPC network that is associated with the spoke.
    pub linked_vpc_network: std::option::Option<crate::model::LinkedVpcNetwork>,

    /// Optional. The linked producer VPC that is associated with the spoke.
    pub linked_producer_vpc_network: std::option::Option<crate::model::LinkedProducerVpcNetwork>,

    /// Output only. The Google-generated UUID for the spoke. This value is unique
    /// across all spoke resources. If a spoke is deleted and another with the same
    /// name is created, the new spoke is assigned a different `unique_id`.
    pub unique_id: std::string::String,

    /// Output only. The current lifecycle state of this spoke.
    pub state: crate::model::State,

    /// Output only. The reasons for current state of the spoke.
    pub reasons: std::vec::Vec<crate::model::spoke::StateReason>,

    /// Output only. The type of resource associated with the spoke.
    pub spoke_type: crate::model::SpokeType,

    /// Optional. This checksum is computed by the server based on the value of
    /// other fields, and may be sent on update and delete requests to ensure the
    /// client has an up-to-date value before proceeding.
    pub etag: std::string::String,

    /// Optional. The list of fields waiting for hub administration's approval.
    pub field_paths_pending_update: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Spoke {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Spoke::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Spoke::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Spoke::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Spoke::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Spoke::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Spoke::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Spoke::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [hub][crate::model::Spoke::hub].
    pub fn set_hub<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.hub = v.into();
        self
    }

    /// Sets the value of [group][crate::model::Spoke::group].
    pub fn set_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.group = v.into();
        self
    }

    /// Sets the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
    pub fn set_linked_vpn_tunnels<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::LinkedVpnTunnels>,
    {
        self.linked_vpn_tunnels = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [linked_vpn_tunnels][crate::model::Spoke::linked_vpn_tunnels].
    pub fn set_or_clear_linked_vpn_tunnels<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::LinkedVpnTunnels>,
    {
        self.linked_vpn_tunnels = v.map(|x| x.into());
        self
    }

    /// Sets the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
    pub fn set_linked_interconnect_attachments<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
    {
        self.linked_interconnect_attachments = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [linked_interconnect_attachments][crate::model::Spoke::linked_interconnect_attachments].
    pub fn set_or_clear_linked_interconnect_attachments<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::LinkedInterconnectAttachments>,
    {
        self.linked_interconnect_attachments = v.map(|x| x.into());
        self
    }

    /// Sets the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
    pub fn set_linked_router_appliance_instances<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
    {
        self.linked_router_appliance_instances = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [linked_router_appliance_instances][crate::model::Spoke::linked_router_appliance_instances].
    pub fn set_or_clear_linked_router_appliance_instances<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::LinkedRouterApplianceInstances>,
    {
        self.linked_router_appliance_instances = v.map(|x| x.into());
        self
    }

    /// Sets the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
    pub fn set_linked_vpc_network<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::LinkedVpcNetwork>,
    {
        self.linked_vpc_network = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [linked_vpc_network][crate::model::Spoke::linked_vpc_network].
    pub fn set_or_clear_linked_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::LinkedVpcNetwork>,
    {
        self.linked_vpc_network = v.map(|x| x.into());
        self
    }

    /// Sets the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
    pub fn set_linked_producer_vpc_network<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
    {
        self.linked_producer_vpc_network = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [linked_producer_vpc_network][crate::model::Spoke::linked_producer_vpc_network].
    pub fn set_or_clear_linked_producer_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::LinkedProducerVpcNetwork>,
    {
        self.linked_producer_vpc_network = v.map(|x| x.into());
        self
    }

    /// Sets the value of [unique_id][crate::model::Spoke::unique_id].
    pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.unique_id = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Spoke::state].
    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [reasons][crate::model::Spoke::reasons].
    pub fn set_reasons<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::spoke::StateReason>,
    {
        use std::iter::Iterator;
        self.reasons = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [spoke_type][crate::model::Spoke::spoke_type].
    pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(mut self, v: T) -> Self {
        self.spoke_type = v.into();
        self
    }

    /// Sets the value of [etag][crate::model::Spoke::etag].
    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.etag = v.into();
        self
    }

    /// Sets the value of [field_paths_pending_update][crate::model::Spoke::field_paths_pending_update].
    pub fn set_field_paths_pending_update<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.field_paths_pending_update = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for Spoke {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke"
    }
}

/// Defines additional types related to [Spoke].
pub mod spoke {
    #[allow(unused_imports)]
    use super::*;

    /// The reason a spoke is inactive.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct StateReason {
        /// The code associated with this reason.
        pub code: crate::model::spoke::state_reason::Code,

        /// Human-readable details about this reason.
        pub message: std::string::String,

        /// Additional information provided by the user in the RejectSpoke call.
        pub user_details: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl StateReason {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [code][crate::model::spoke::StateReason::code].
        pub fn set_code<T: std::convert::Into<crate::model::spoke::state_reason::Code>>(
            mut self,
            v: T,
        ) -> Self {
            self.code = v.into();
            self
        }

        /// Sets the value of [message][crate::model::spoke::StateReason::message].
        pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.message = v.into();
            self
        }

        /// Sets the value of [user_details][crate::model::spoke::StateReason::user_details].
        pub fn set_user_details<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.user_details = v.into();
            self
        }
    }

    impl wkt::message::Message for StateReason {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.Spoke.StateReason"
        }
    }

    /// Defines additional types related to [StateReason].
    pub mod state_reason {
        #[allow(unused_imports)]
        use super::*;

        /// The Code enum represents the various reasons a state can be `INACTIVE`.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Code {
            /// No information available.
            Unspecified,
            /// The proposed spoke is pending review.
            PendingReview,
            /// The proposed spoke has been rejected by the hub administrator.
            Rejected,
            /// The spoke has been deactivated internally.
            Paused,
            /// Network Connectivity Center encountered errors while accepting
            /// the spoke.
            Failed,
            /// The proposed spoke update is pending review.
            UpdatePendingReview,
            /// The proposed spoke update has been rejected by the hub administrator.
            UpdateRejected,
            /// Network Connectivity Center encountered errors while accepting
            /// the spoke update.
            UpdateFailed,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [Code::value] or
            /// [Code::name].
            UnknownValue(code::UnknownValue),
        }

        #[doc(hidden)]
        pub mod code {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl Code {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::PendingReview => std::option::Option::Some(1),
                    Self::Rejected => std::option::Option::Some(2),
                    Self::Paused => std::option::Option::Some(3),
                    Self::Failed => std::option::Option::Some(4),
                    Self::UpdatePendingReview => std::option::Option::Some(5),
                    Self::UpdateRejected => std::option::Option::Some(6),
                    Self::UpdateFailed => std::option::Option::Some(7),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
                    Self::PendingReview => std::option::Option::Some("PENDING_REVIEW"),
                    Self::Rejected => std::option::Option::Some("REJECTED"),
                    Self::Paused => std::option::Option::Some("PAUSED"),
                    Self::Failed => std::option::Option::Some("FAILED"),
                    Self::UpdatePendingReview => std::option::Option::Some("UPDATE_PENDING_REVIEW"),
                    Self::UpdateRejected => std::option::Option::Some("UPDATE_REJECTED"),
                    Self::UpdateFailed => std::option::Option::Some("UPDATE_FAILED"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for Code {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for Code {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for Code {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::PendingReview,
                    2 => Self::Rejected,
                    3 => Self::Paused,
                    4 => Self::Failed,
                    5 => Self::UpdatePendingReview,
                    6 => Self::UpdateRejected,
                    7 => Self::UpdateFailed,
                    _ => Self::UnknownValue(code::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for Code {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "CODE_UNSPECIFIED" => Self::Unspecified,
                    "PENDING_REVIEW" => Self::PendingReview,
                    "REJECTED" => Self::Rejected,
                    "PAUSED" => Self::Paused,
                    "FAILED" => Self::Failed,
                    "UPDATE_PENDING_REVIEW" => Self::UpdatePendingReview,
                    "UPDATE_REJECTED" => Self::UpdateRejected,
                    "UPDATE_FAILED" => Self::UpdateFailed,
                    _ => Self::UnknownValue(code::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for Code {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::PendingReview => serializer.serialize_i32(1),
                    Self::Rejected => serializer.serialize_i32(2),
                    Self::Paused => serializer.serialize_i32(3),
                    Self::Failed => serializer.serialize_i32(4),
                    Self::UpdatePendingReview => serializer.serialize_i32(5),
                    Self::UpdateRejected => serializer.serialize_i32(6),
                    Self::UpdateFailed => serializer.serialize_i32(7),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for Code {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
                    ".google.cloud.networkconnectivity.v1.Spoke.StateReason.Code",
                ))
            }
        }
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouteTable {
    /// Immutable. The name of the route table. Route table names must be unique.
    /// They use the following form:
    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}`
    pub name: std::string::String,

    /// Output only. The time the route table was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the route table was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional labels in key-value pair format. For more information about
    /// labels, see [Requirements for
    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// An optional description of the route table.
    pub description: std::string::String,

    /// Output only. The Google-generated UUID for the route table. This value is
    /// unique across all route table resources. If a route table is deleted and
    /// another with the same name is created, the new route table is assigned
    /// a different `uid`.
    pub uid: std::string::String,

    /// Output only. The current lifecycle state of this route table.
    pub state: crate::model::State,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RouteTable {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::RouteTable::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::RouteTable::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::RouteTable::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::RouteTable::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::RouteTable::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::RouteTable::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::RouteTable::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [uid][crate::model::RouteTable::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [state][crate::model::RouteTable::state].
    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }
}

impl wkt::message::Message for RouteTable {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouteTable"
    }
}

/// A route defines a path from VM instances within a spoke to a specific
/// destination resource. Only VPC spokes have routes.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Route {
    /// Immutable. The name of the route. Route names must be unique. Route names
    /// use the following form:
    /// `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}`
    pub name: std::string::String,

    /// Output only. The time the route was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the route was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// The destination IP address range.
    pub ip_cidr_range: std::string::String,

    /// Output only. The route's type. Its type is determined by the properties of
    /// its IP address range.
    pub r#type: crate::model::RouteType,

    /// Immutable. The destination VPC network for packets on this route.
    pub next_hop_vpc_network: std::option::Option<crate::model::NextHopVpcNetwork>,

    /// Optional labels in key-value pair format. For more information about
    /// labels, see [Requirements for
    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// An optional description of the route.
    pub description: std::string::String,

    /// Output only. The Google-generated UUID for the route. This value is unique
    /// across all Network Connectivity Center route resources. If a
    /// route is deleted and another with the same name is created,
    /// the new route is assigned a different `uid`.
    pub uid: std::string::String,

    /// Output only. The current lifecycle state of the route.
    pub state: crate::model::State,

    /// Immutable. The spoke that this route leads to.
    /// Example: projects/12345/locations/global/spokes/SPOKE
    pub spoke: std::string::String,

    /// Output only. The origin location of the route.
    /// Uses the following form: "projects/{project}/locations/{location}"
    /// Example: projects/1234/locations/us-central1
    pub location: std::string::String,

    /// Output only. The priority of this route. Priority is used to break ties in
    /// cases where a destination matches more than one route. In these cases the
    /// route with the lowest-numbered priority value wins.
    pub priority: i64,

    /// Immutable. The next-hop VPN tunnel for packets on this route.
    pub next_hop_vpn_tunnel: std::option::Option<crate::model::NextHopVPNTunnel>,

    /// Immutable. The next-hop Router appliance instance for packets on this
    /// route.
    pub next_hop_router_appliance_instance:
        std::option::Option<crate::model::NextHopRouterApplianceInstance>,

    /// Immutable. The next-hop VLAN attachment for packets on this route.
    pub next_hop_interconnect_attachment:
        std::option::Option<crate::model::NextHopInterconnectAttachment>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Route {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Route::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Route::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Route::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Route::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Route::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [ip_cidr_range][crate::model::Route::ip_cidr_range].
    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.ip_cidr_range = v.into();
        self
    }

    /// Sets the value of [r#type][crate::model::Route::type].
    pub fn set_type<T: std::convert::Into<crate::model::RouteType>>(mut self, v: T) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
    pub fn set_next_hop_vpc_network<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NextHopVpcNetwork>,
    {
        self.next_hop_vpc_network = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [next_hop_vpc_network][crate::model::Route::next_hop_vpc_network].
    pub fn set_or_clear_next_hop_vpc_network<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::NextHopVpcNetwork>,
    {
        self.next_hop_vpc_network = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Route::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Route::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [uid][crate::model::Route::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Route::state].
    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [spoke][crate::model::Route::spoke].
    pub fn set_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke = v.into();
        self
    }

    /// Sets the value of [location][crate::model::Route::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [priority][crate::model::Route::priority].
    pub fn set_priority<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.priority = v.into();
        self
    }

    /// Sets the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
    pub fn set_next_hop_vpn_tunnel<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NextHopVPNTunnel>,
    {
        self.next_hop_vpn_tunnel = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [next_hop_vpn_tunnel][crate::model::Route::next_hop_vpn_tunnel].
    pub fn set_or_clear_next_hop_vpn_tunnel<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::NextHopVPNTunnel>,
    {
        self.next_hop_vpn_tunnel = v.map(|x| x.into());
        self
    }

    /// Sets the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
    pub fn set_next_hop_router_appliance_instance<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
    {
        self.next_hop_router_appliance_instance = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [next_hop_router_appliance_instance][crate::model::Route::next_hop_router_appliance_instance].
    pub fn set_or_clear_next_hop_router_appliance_instance<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::NextHopRouterApplianceInstance>,
    {
        self.next_hop_router_appliance_instance = v.map(|x| x.into());
        self
    }

    /// Sets the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
    pub fn set_next_hop_interconnect_attachment<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
    {
        self.next_hop_interconnect_attachment = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [next_hop_interconnect_attachment][crate::model::Route::next_hop_interconnect_attachment].
    pub fn set_or_clear_next_hop_interconnect_attachment<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::NextHopInterconnectAttachment>,
    {
        self.next_hop_interconnect_attachment = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Route {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.Route"
    }
}

/// A group represents a subset of spokes attached to a hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Group {
    /// Immutable. The name of the group. Group names must be unique. They
    /// use the following form:
    /// `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}`
    pub name: std::string::String,

    /// Output only. The time the group was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the group was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Labels in key-value pair format. For more information about
    /// labels, see [Requirements for
    /// labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements).
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. The description of the group.
    pub description: std::string::String,

    /// Output only. The Google-generated UUID for the group. This value is unique
    /// across all group resources. If a group is deleted and
    /// another with the same name is created, the new route table is assigned
    /// a different unique_id.
    pub uid: std::string::String,

    /// Output only. The current lifecycle state of this group.
    pub state: crate::model::State,

    /// Optional. The auto-accept setting for this group.
    pub auto_accept: std::option::Option<crate::model::AutoAccept>,

    /// Output only. The name of the route table that corresponds to this group.
    /// They use the following form:
    /// `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}`
    pub route_table: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Group {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Group::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Group::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Group::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Group::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Group::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::Group::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::Group::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [uid][crate::model::Group::uid].
    pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uid = v.into();
        self
    }

    /// Sets the value of [state][crate::model::Group::state].
    pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [auto_accept][crate::model::Group::auto_accept].
    pub fn set_auto_accept<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AutoAccept>,
    {
        self.auto_accept = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [auto_accept][crate::model::Group::auto_accept].
    pub fn set_or_clear_auto_accept<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AutoAccept>,
    {
        self.auto_accept = v.map(|x| x.into());
        self
    }

    /// Sets the value of [route_table][crate::model::Group::route_table].
    pub fn set_route_table<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.route_table = v.into();
        self
    }
}

impl wkt::message::Message for Group {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.Group"
    }
}

/// The auto-accept setting for a group controls whether
/// proposed spokes are automatically attached to the hub. If auto-accept is
/// enabled, the spoke immediately is attached to the hub and becomes part of the
/// group. In this case, the new spoke is in the ACTIVE state.
/// If auto-accept is disabled, the spoke goes to the INACTIVE
/// state, and it must be reviewed and accepted by a hub
/// administrator.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AutoAccept {
    /// Optional. A list of project ids or project numbers for which you want
    /// to enable auto-accept. The auto-accept setting is applied to
    /// spokes being created or updated in these projects.
    pub auto_accept_projects: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AutoAccept {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [auto_accept_projects][crate::model::AutoAccept::auto_accept_projects].
    pub fn set_auto_accept_projects<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.auto_accept_projects = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for AutoAccept {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.AutoAccept"
    }
}

/// Request for
/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubsRequest {
    /// Required. The parent resource's name.
    pub parent: std::string::String,

    /// The maximum number of results per page to return.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// An expression that filters the list of results.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHubsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListHubsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListHubsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListHubsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListHubsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListHubsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListHubsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsRequest"
    }
}

/// Response for
/// [HubService.ListHubs][google.cloud.networkconnectivity.v1.HubService.ListHubs]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListHubs]: crate::client::HubService::list_hubs
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubsResponse {
    /// The requested hubs.
    pub hubs: std::vec::Vec<crate::model::Hub>,

    /// The token for the next page of the response. To see more results,
    /// use this value as the page_token for your next request. If this value
    /// is empty, there are no more results.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHubsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [hubs][crate::model::ListHubsResponse::hubs].
    pub fn set_hubs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Hub>,
    {
        use std::iter::Iterator;
        self.hubs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListHubsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListHubsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListHubsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListHubsResponse {
    type PageItem = crate::model::Hub;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.hubs
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for
/// [HubService.GetHub][google.cloud.networkconnectivity.v1.HubService.GetHub]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.GetHub]: crate::client::HubService::get_hub
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetHubRequest {
    /// Required. The name of the hub resource to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetHubRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetHubRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetHubRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetHubRequest"
    }
}

/// Request for
/// [HubService.CreateHub][google.cloud.networkconnectivity.v1.HubService.CreateHub]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.CreateHub]: crate::client::HubService::create_hub
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateHubRequest {
    /// Required. The parent resource.
    pub parent: std::string::String,

    /// Required. A unique identifier for the hub.
    pub hub_id: std::string::String,

    /// Required. The initial values for a new hub.
    pub hub: std::option::Option<crate::model::Hub>,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateHubRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateHubRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [hub_id][crate::model::CreateHubRequest::hub_id].
    pub fn set_hub_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.hub_id = v.into();
        self
    }

    /// Sets the value of [hub][crate::model::CreateHubRequest::hub].
    pub fn set_hub<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Hub>,
    {
        self.hub = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hub][crate::model::CreateHubRequest::hub].
    pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Hub>,
    {
        self.hub = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateHubRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateHubRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateHubRequest"
    }
}

/// Request for
/// [HubService.UpdateHub][google.cloud.networkconnectivity.v1.HubService.UpdateHub]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.UpdateHub]: crate::client::HubService::update_hub
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateHubRequest {
    /// Optional. In the case of an update to an existing hub, field mask is used
    /// to specify the fields to be overwritten. The fields specified in the
    /// update_mask are relative to the resource, not the full request. A field is
    /// overwritten if it is in the mask. If the user does not provide a mask, then
    /// all fields are overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The state that the hub should be in after the update.
    pub hub: std::option::Option<crate::model::Hub>,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateHubRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateHubRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [hub][crate::model::UpdateHubRequest::hub].
    pub fn set_hub<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Hub>,
    {
        self.hub = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hub][crate::model::UpdateHubRequest::hub].
    pub fn set_or_clear_hub<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Hub>,
    {
        self.hub = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateHubRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateHubRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateHubRequest"
    }
}

/// The request for
/// [HubService.DeleteHub][google.cloud.networkconnectivity.v1.HubService.DeleteHub].
///
/// [google.cloud.networkconnectivity.v1.HubService.DeleteHub]: crate::client::HubService::delete_hub
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteHubRequest {
    /// Required. The name of the hub to delete.
    pub name: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteHubRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteHubRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteHubRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteHubRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteHubRequest"
    }
}

/// The request for
/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
///
/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubSpokesRequest {
    /// Required. The name of the hub.
    pub name: std::string::String,

    /// A list of locations.
    /// Specify one of the following: `[global]`, a single region (for
    /// example, `[us-central1]`), or a combination of
    /// values (for example, `[global, us-central1, us-west1]`).
    /// If the spoke_locations field is populated, the list of results
    /// includes only spokes in the specified location.
    /// If the spoke_locations field is not populated, the list of results
    /// includes spokes in all locations.
    pub spoke_locations: std::vec::Vec<std::string::String>,

    /// The maximum number of results to return per page.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// An expression that filters the list of results.
    pub filter: std::string::String,

    /// Sort the results by name or create_time.
    pub order_by: std::string::String,

    /// The view of the spoke to return.
    /// The view that you use determines which spoke fields are included in the
    /// response.
    pub view: crate::model::list_hub_spokes_request::SpokeView,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHubSpokesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ListHubSpokesRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [spoke_locations][crate::model::ListHubSpokesRequest::spoke_locations].
    pub fn set_spoke_locations<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.spoke_locations = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [page_size][crate::model::ListHubSpokesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListHubSpokesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListHubSpokesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListHubSpokesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [view][crate::model::ListHubSpokesRequest::view].
    pub fn set_view<T: std::convert::Into<crate::model::list_hub_spokes_request::SpokeView>>(
        mut self,
        v: T,
    ) -> Self {
        self.view = v.into();
        self
    }
}

impl wkt::message::Message for ListHubSpokesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"
    }
}

/// Defines additional types related to [ListHubSpokesRequest].
pub mod list_hub_spokes_request {
    #[allow(unused_imports)]
    use super::*;

    /// Enum that controls which spoke fields are included in the response.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum SpokeView {
        /// The spoke view is unspecified. When the spoke view is unspecified, the
        /// API returns the same fields as the `BASIC` view.
        Unspecified,
        /// Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`,
        /// and `spoke_type`. This is the default value.
        Basic,
        /// Includes all spoke fields except `labels`.
        /// You can use the `DETAILED` view only when you set the `spoke_locations`
        /// field to `[global]`.
        Detailed,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [SpokeView::value] or
        /// [SpokeView::name].
        UnknownValue(spoke_view::UnknownValue),
    }

    #[doc(hidden)]
    pub mod spoke_view {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl SpokeView {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Basic => std::option::Option::Some(1),
                Self::Detailed => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("SPOKE_VIEW_UNSPECIFIED"),
                Self::Basic => std::option::Option::Some("BASIC"),
                Self::Detailed => std::option::Option::Some("DETAILED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for SpokeView {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for SpokeView {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for SpokeView {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Basic,
                2 => Self::Detailed,
                _ => Self::UnknownValue(spoke_view::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for SpokeView {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "SPOKE_VIEW_UNSPECIFIED" => Self::Unspecified,
                "BASIC" => Self::Basic,
                "DETAILED" => Self::Detailed,
                _ => Self::UnknownValue(spoke_view::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for SpokeView {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Basic => serializer.serialize_i32(1),
                Self::Detailed => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for SpokeView {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeView>::new(
                ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView",
            ))
        }
    }
}

/// The response for
/// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes].
///
/// [google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]: crate::client::HubService::list_hub_spokes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListHubSpokesResponse {
    /// The requested spokes.
    /// The spoke fields can be partially populated based on the `view` field in
    /// the request message.
    pub spokes: std::vec::Vec<crate::model::Spoke>,

    /// The token for the next page of the response. To see more results,
    /// use this value as the page_token for your next request. If this value
    /// is empty, there are no more results.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListHubSpokesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spokes][crate::model::ListHubSpokesResponse::spokes].
    pub fn set_spokes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Spoke>,
    {
        use std::iter::Iterator;
        self.spokes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListHubSpokesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListHubSpokesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListHubSpokesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListHubSpokesResponse {
    type PageItem = crate::model::Spoke;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.spokes
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The request for
/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
///
/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryHubStatusRequest {
    /// Required. The name of the hub.
    pub name: std::string::String,

    /// Optional. The maximum number of results to return per page.
    pub page_size: i32,

    /// Optional. The page token.
    pub page_token: std::string::String,

    /// Optional. An expression that filters the list of results.
    /// The filter can be used to filter the results by the following fields:
    ///
    /// * `psc_propagation_status.source_spoke`
    /// * `psc_propagation_status.source_group`
    /// * `psc_propagation_status.source_forwarding_rule`
    /// * `psc_propagation_status.target_spoke`
    /// * `psc_propagation_status.target_group`
    /// * `psc_propagation_status.code`
    /// * `psc_propagation_status.message`
    pub filter: std::string::String,

    /// Optional. Sort the results in ascending order by the specified fields.
    /// A comma-separated list of any of these fields:
    ///
    /// * `psc_propagation_status.source_spoke`
    /// * `psc_propagation_status.source_group`
    /// * `psc_propagation_status.source_forwarding_rule`
    /// * `psc_propagation_status.target_spoke`
    /// * `psc_propagation_status.target_group`
    /// * `psc_propagation_status.code`
    ///   If `group_by` is set, the value of the `order_by` field must be the
    ///   same as or a subset of the `group_by` field.
    pub order_by: std::string::String,

    /// Optional. Aggregate the results by the specified fields.
    /// A comma-separated list of any of these fields:
    ///
    /// * `psc_propagation_status.source_spoke`
    /// * `psc_propagation_status.source_group`
    /// * `psc_propagation_status.source_forwarding_rule`
    /// * `psc_propagation_status.target_spoke`
    /// * `psc_propagation_status.target_group`
    /// * `psc_propagation_status.code`
    pub group_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryHubStatusRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::QueryHubStatusRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::QueryHubStatusRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::QueryHubStatusRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::QueryHubStatusRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::QueryHubStatusRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }

    /// Sets the value of [group_by][crate::model::QueryHubStatusRequest::group_by].
    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.group_by = v.into();
        self
    }
}

impl wkt::message::Message for QueryHubStatusRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusRequest"
    }
}

/// The response for
/// [HubService.QueryHubStatus][google.cloud.networkconnectivity.v1.HubService.QueryHubStatus].
///
/// [google.cloud.networkconnectivity.v1.HubService.QueryHubStatus]: crate::client::HubService::query_hub_status
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryHubStatusResponse {
    /// The list of hub status.
    pub hub_status_entries: std::vec::Vec<crate::model::HubStatusEntry>,

    /// The token for the next page of the response. To see more results,
    /// use this value as the page_token for your next request. If this value
    /// is empty, there are no more results.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl QueryHubStatusResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [hub_status_entries][crate::model::QueryHubStatusResponse::hub_status_entries].
    pub fn set_hub_status_entries<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::HubStatusEntry>,
    {
        use std::iter::Iterator;
        self.hub_status_entries = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::QueryHubStatusResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for QueryHubStatusResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.QueryHubStatusResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for QueryHubStatusResponse {
    type PageItem = crate::model::HubStatusEntry;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.hub_status_entries
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// A hub status entry represents the status of a set of propagated Private
/// Service Connect connections grouped by certain fields.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct HubStatusEntry {
    /// The number of propagated Private Service Connect connections with this
    /// status. If the `group_by` field was not set in the request message, the
    /// value of this field is 1.
    pub count: i32,

    /// The fields that this entry is grouped by. This has the same value as the
    /// `group_by` field in the request message.
    pub group_by: std::string::String,

    /// The Private Service Connect propagation status.
    pub psc_propagation_status: std::option::Option<crate::model::PscPropagationStatus>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl HubStatusEntry {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [count][crate::model::HubStatusEntry::count].
    pub fn set_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.count = v.into();
        self
    }

    /// Sets the value of [group_by][crate::model::HubStatusEntry::group_by].
    pub fn set_group_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.group_by = v.into();
        self
    }

    /// Sets the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
    pub fn set_psc_propagation_status<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PscPropagationStatus>,
    {
        self.psc_propagation_status = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [psc_propagation_status][crate::model::HubStatusEntry::psc_propagation_status].
    pub fn set_or_clear_psc_propagation_status<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PscPropagationStatus>,
    {
        self.psc_propagation_status = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for HubStatusEntry {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.HubStatusEntry"
    }
}

/// The status of one or more propagated Private Service Connect connections in a
/// hub.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PscPropagationStatus {
    /// The name of the spoke that the source forwarding rule belongs to.
    pub source_spoke: std::string::String,

    /// The name of the group that the source spoke belongs to.
    pub source_group: std::string::String,

    /// The name of the forwarding rule exported to the hub.
    pub source_forwarding_rule: std::string::String,

    /// The name of the spoke that the source forwarding rule propagates to.
    pub target_spoke: std::string::String,

    /// The name of the group that the target spoke belongs to.
    pub target_group: std::string::String,

    /// The propagation status.
    pub code: crate::model::psc_propagation_status::Code,

    /// The human-readable summary of the Private Service Connect connection
    /// propagation status.
    pub message: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PscPropagationStatus {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [source_spoke][crate::model::PscPropagationStatus::source_spoke].
    pub fn set_source_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source_spoke = v.into();
        self
    }

    /// Sets the value of [source_group][crate::model::PscPropagationStatus::source_group].
    pub fn set_source_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.source_group = v.into();
        self
    }

    /// Sets the value of [source_forwarding_rule][crate::model::PscPropagationStatus::source_forwarding_rule].
    pub fn set_source_forwarding_rule<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.source_forwarding_rule = v.into();
        self
    }

    /// Sets the value of [target_spoke][crate::model::PscPropagationStatus::target_spoke].
    pub fn set_target_spoke<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target_spoke = v.into();
        self
    }

    /// Sets the value of [target_group][crate::model::PscPropagationStatus::target_group].
    pub fn set_target_group<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.target_group = v.into();
        self
    }

    /// Sets the value of [code][crate::model::PscPropagationStatus::code].
    pub fn set_code<T: std::convert::Into<crate::model::psc_propagation_status::Code>>(
        mut self,
        v: T,
    ) -> Self {
        self.code = v.into();
        self
    }

    /// Sets the value of [message][crate::model::PscPropagationStatus::message].
    pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.message = v.into();
        self
    }
}

impl wkt::message::Message for PscPropagationStatus {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.PscPropagationStatus"
    }
}

/// Defines additional types related to [PscPropagationStatus].
pub mod psc_propagation_status {
    #[allow(unused_imports)]
    use super::*;

    /// The Code enum represents the state of the Private Service Connect
    /// propagation.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Code {
        /// The code is unspecified.
        Unspecified,
        /// The propagated Private Service Connect connection is ready.
        Ready,
        /// The Private Service Connect connection is propagating. This is a
        /// transient state.
        Propagating,
        /// The Private Service Connect connection propagation failed because the VPC
        /// network or the project of the target spoke has exceeded the connection
        /// limit set by the producer.
        ErrorProducerPropagatedConnectionLimitExceeded,
        /// The Private Service Connect connection propagation failed because the NAT
        /// IP subnet space has been exhausted. It is equivalent to the `Needs
        /// attention` status of the Private Service Connect connection. See
        /// <https://cloud.google.com/vpc/docs/about-accessing-vpc-hosted-services-endpoints#connection-statuses>.
        ErrorProducerNatIpSpaceExhausted,
        /// The Private Service Connect connection propagation failed because the
        /// `PSC_ILB_CONSUMER_FORWARDING_RULES_PER_PRODUCER_NETWORK` quota in the
        /// producer VPC network has been exceeded.
        ErrorProducerQuotaExceeded,
        /// The Private Service Connect connection propagation failed because the
        /// `PSC_PROPAGATED_CONNECTIONS_PER_VPC_NETWORK` quota in the consumer
        /// VPC network has been exceeded.
        ErrorConsumerQuotaExceeded,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Code::value] or
        /// [Code::name].
        UnknownValue(code::UnknownValue),
    }

    #[doc(hidden)]
    pub mod code {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Code {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Ready => std::option::Option::Some(1),
                Self::Propagating => std::option::Option::Some(2),
                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
                    std::option::Option::Some(3)
                }
                Self::ErrorProducerNatIpSpaceExhausted => std::option::Option::Some(4),
                Self::ErrorProducerQuotaExceeded => std::option::Option::Some(5),
                Self::ErrorConsumerQuotaExceeded => std::option::Option::Some(6),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CODE_UNSPECIFIED"),
                Self::Ready => std::option::Option::Some("READY"),
                Self::Propagating => std::option::Option::Some("PROPAGATING"),
                Self::ErrorProducerPropagatedConnectionLimitExceeded => {
                    std::option::Option::Some("ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED")
                }
                Self::ErrorProducerNatIpSpaceExhausted => {
                    std::option::Option::Some("ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED")
                }
                Self::ErrorProducerQuotaExceeded => {
                    std::option::Option::Some("ERROR_PRODUCER_QUOTA_EXCEEDED")
                }
                Self::ErrorConsumerQuotaExceeded => {
                    std::option::Option::Some("ERROR_CONSUMER_QUOTA_EXCEEDED")
                }
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Code {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Code {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Code {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Ready,
                2 => Self::Propagating,
                3 => Self::ErrorProducerPropagatedConnectionLimitExceeded,
                4 => Self::ErrorProducerNatIpSpaceExhausted,
                5 => Self::ErrorProducerQuotaExceeded,
                6 => Self::ErrorConsumerQuotaExceeded,
                _ => Self::UnknownValue(code::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Code {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CODE_UNSPECIFIED" => Self::Unspecified,
                "READY" => Self::Ready,
                "PROPAGATING" => Self::Propagating,
                "ERROR_PRODUCER_PROPAGATED_CONNECTION_LIMIT_EXCEEDED" => {
                    Self::ErrorProducerPropagatedConnectionLimitExceeded
                }
                "ERROR_PRODUCER_NAT_IP_SPACE_EXHAUSTED" => Self::ErrorProducerNatIpSpaceExhausted,
                "ERROR_PRODUCER_QUOTA_EXCEEDED" => Self::ErrorProducerQuotaExceeded,
                "ERROR_CONSUMER_QUOTA_EXCEEDED" => Self::ErrorConsumerQuotaExceeded,
                _ => Self::UnknownValue(code::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Code {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Ready => serializer.serialize_i32(1),
                Self::Propagating => serializer.serialize_i32(2),
                Self::ErrorProducerPropagatedConnectionLimitExceeded => serializer.serialize_i32(3),
                Self::ErrorProducerNatIpSpaceExhausted => serializer.serialize_i32(4),
                Self::ErrorProducerQuotaExceeded => serializer.serialize_i32(5),
                Self::ErrorConsumerQuotaExceeded => serializer.serialize_i32(6),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Code {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
                ".google.cloud.networkconnectivity.v1.PscPropagationStatus.Code",
            ))
        }
    }
}

/// The request for
/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
///
/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpokesRequest {
    /// Required. The parent resource.
    pub parent: std::string::String,

    /// The maximum number of results to return per page.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// An expression that filters the list of results.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListSpokesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListSpokesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListSpokesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListSpokesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListSpokesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListSpokesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListSpokesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesRequest"
    }
}

/// The response for
/// [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes].
///
/// [google.cloud.networkconnectivity.v1.HubService.ListSpokes]: crate::client::HubService::list_spokes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpokesResponse {
    /// The requested spokes.
    pub spokes: std::vec::Vec<crate::model::Spoke>,

    /// The token for the next page of the response. To see more results,
    /// use this value as the page_token for your next request. If this value
    /// is empty, there are no more results.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListSpokesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spokes][crate::model::ListSpokesResponse::spokes].
    pub fn set_spokes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Spoke>,
    {
        use std::iter::Iterator;
        self.spokes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListSpokesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListSpokesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListSpokesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListSpokesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListSpokesResponse {
    type PageItem = crate::model::Spoke;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.spokes
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The request for
/// [HubService.GetSpoke][google.cloud.networkconnectivity.v1.HubService.GetSpoke].
///
/// [google.cloud.networkconnectivity.v1.HubService.GetSpoke]: crate::client::HubService::get_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpokeRequest {
    /// Required. The name of the spoke resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetSpokeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetSpokeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetSpokeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetSpokeRequest"
    }
}

/// The request for
/// [HubService.CreateSpoke][google.cloud.networkconnectivity.v1.HubService.CreateSpoke].
///
/// [google.cloud.networkconnectivity.v1.HubService.CreateSpoke]: crate::client::HubService::create_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSpokeRequest {
    /// Required. The parent resource.
    pub parent: std::string::String,

    /// Required. Unique id for the spoke to create.
    pub spoke_id: std::string::String,

    /// Required. The initial values for a new spoke.
    pub spoke: std::option::Option<crate::model::Spoke>,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateSpokeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateSpokeRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [spoke_id][crate::model::CreateSpokeRequest::spoke_id].
    pub fn set_spoke_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke_id = v.into();
        self
    }

    /// Sets the value of [spoke][crate::model::CreateSpokeRequest::spoke].
    pub fn set_spoke<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spoke][crate::model::CreateSpokeRequest::spoke].
    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateSpokeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateSpokeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateSpokeRequest"
    }
}

/// Request for
/// [HubService.UpdateSpoke][google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.UpdateSpoke]: crate::client::HubService::update_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSpokeRequest {
    /// Optional. In the case of an update to an existing spoke, field mask is used
    /// to specify the fields to be overwritten. The fields specified in the
    /// update_mask are relative to the resource, not the full request. A field is
    /// overwritten if it is in the mask. If the user does not provide a mask, then
    /// all fields are overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The state that the spoke should be in after the update.
    pub spoke: std::option::Option<crate::model::Spoke>,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateSpokeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateSpokeRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
    pub fn set_spoke<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spoke][crate::model::UpdateSpokeRequest::spoke].
    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateSpokeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateSpokeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"
    }
}

/// The request for
/// [HubService.DeleteSpoke][google.cloud.networkconnectivity.v1.HubService.DeleteSpoke].
///
/// [google.cloud.networkconnectivity.v1.HubService.DeleteSpoke]: crate::client::HubService::delete_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSpokeRequest {
    /// Required. The name of the spoke to delete.
    pub name: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteSpokeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteSpokeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteSpokeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteSpokeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"
    }
}

/// The request for
/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
///
/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptHubSpokeRequest {
    /// Required. The name of the hub into which to accept the spoke.
    pub name: std::string::String,

    /// Required. The URI of the spoke to accept into the hub.
    pub spoke_uri: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AcceptHubSpokeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::AcceptHubSpokeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [spoke_uri][crate::model::AcceptHubSpokeRequest::spoke_uri].
    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke_uri = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::AcceptHubSpokeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for AcceptHubSpokeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"
    }
}

/// The response for
/// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke].
///
/// [google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]: crate::client::HubService::accept_hub_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptHubSpokeResponse {
    /// The spoke that was operated on.
    pub spoke: std::option::Option<crate::model::Spoke>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AcceptHubSpokeResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
    pub fn set_spoke<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spoke][crate::model::AcceptHubSpokeResponse::spoke].
    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for AcceptHubSpokeResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"
    }
}

/// The request for
/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
///
/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectHubSpokeRequest {
    /// Required. The name of the hub from which to reject the spoke.
    pub name: std::string::String,

    /// Required. The URI of the spoke to reject from the hub.
    pub spoke_uri: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    /// Optional. Additional information provided by the hub administrator.
    pub details: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RejectHubSpokeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::RejectHubSpokeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [spoke_uri][crate::model::RejectHubSpokeRequest::spoke_uri].
    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke_uri = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::RejectHubSpokeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }

    /// Sets the value of [details][crate::model::RejectHubSpokeRequest::details].
    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.details = v.into();
        self
    }
}

impl wkt::message::Message for RejectHubSpokeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"
    }
}

/// The response for
/// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke].
///
/// [google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]: crate::client::HubService::reject_hub_spoke
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectHubSpokeResponse {
    /// The spoke that was operated on.
    pub spoke: std::option::Option<crate::model::Spoke>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RejectHubSpokeResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
    pub fn set_spoke<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spoke][crate::model::RejectHubSpokeResponse::spoke].
    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for RejectHubSpokeResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"
    }
}

/// The request for
/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
///
/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptSpokeUpdateRequest {
    /// Required. The name of the hub to accept spoke update.
    pub name: std::string::String,

    /// Required. The URI of the spoke to accept update.
    pub spoke_uri: std::string::String,

    /// Required. The etag of the spoke to accept update.
    pub spoke_etag: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AcceptSpokeUpdateRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::AcceptSpokeUpdateRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [spoke_uri][crate::model::AcceptSpokeUpdateRequest::spoke_uri].
    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke_uri = v.into();
        self
    }

    /// Sets the value of [spoke_etag][crate::model::AcceptSpokeUpdateRequest::spoke_etag].
    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke_etag = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::AcceptSpokeUpdateRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for AcceptSpokeUpdateRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateRequest"
    }
}

/// The response for
/// [HubService.AcceptSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate].
///
/// [google.cloud.networkconnectivity.v1.HubService.AcceptSpokeUpdate]: crate::client::HubService::accept_spoke_update
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AcceptSpokeUpdateResponse {
    /// The spoke that was operated on.
    pub spoke: std::option::Option<crate::model::Spoke>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AcceptSpokeUpdateResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
    pub fn set_spoke<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spoke][crate::model::AcceptSpokeUpdateResponse::spoke].
    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for AcceptSpokeUpdateResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse"
    }
}

/// The request for
/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
///
/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectSpokeUpdateRequest {
    /// Required. The name of the hub to reject spoke update.
    pub name: std::string::String,

    /// Required. The URI of the spoke to reject update.
    pub spoke_uri: std::string::String,

    /// Required. The etag of the spoke to reject update.
    pub spoke_etag: std::string::String,

    /// Optional. Additional information provided by the hub administrator.
    pub details: std::string::String,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RejectSpokeUpdateRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::RejectSpokeUpdateRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [spoke_uri][crate::model::RejectSpokeUpdateRequest::spoke_uri].
    pub fn set_spoke_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke_uri = v.into();
        self
    }

    /// Sets the value of [spoke_etag][crate::model::RejectSpokeUpdateRequest::spoke_etag].
    pub fn set_spoke_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.spoke_etag = v.into();
        self
    }

    /// Sets the value of [details][crate::model::RejectSpokeUpdateRequest::details].
    pub fn set_details<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.details = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::RejectSpokeUpdateRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for RejectSpokeUpdateRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateRequest"
    }
}

/// The response for
/// [HubService.RejectSpokeUpdate][google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate].
///
/// [google.cloud.networkconnectivity.v1.HubService.RejectSpokeUpdate]: crate::client::HubService::reject_spoke_update
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RejectSpokeUpdateResponse {
    /// The spoke that was operated on.
    pub spoke: std::option::Option<crate::model::Spoke>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RejectSpokeUpdateResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
    pub fn set_spoke<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [spoke][crate::model::RejectSpokeUpdateResponse::spoke].
    pub fn set_or_clear_spoke<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Spoke>,
    {
        self.spoke = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for RejectSpokeUpdateResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse"
    }
}

/// The request for
/// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable].
///
/// [google.cloud.networkconnectivity.v1.HubService.GetRouteTable]: crate::client::HubService::get_route_table
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRouteTableRequest {
    /// Required. The name of the route table resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetRouteTableRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetRouteTableRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetRouteTableRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteTableRequest"
    }
}

/// The request for
/// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute].
///
/// [google.cloud.networkconnectivity.v1.HubService.GetRoute]: crate::client::HubService::get_route
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRouteRequest {
    /// Required. The name of the route resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetRouteRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetRouteRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetRouteRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetRouteRequest"
    }
}

/// Request for
/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRoutesRequest {
    /// Required. The parent resource's name.
    pub parent: std::string::String,

    /// The maximum number of results to return per page.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// An expression that filters the list of results.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRoutesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListRoutesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesRequest"
    }
}

/// Response for
/// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListRoutes]: crate::client::HubService::list_routes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRoutesResponse {
    /// The requested routes.
    pub routes: std::vec::Vec<crate::model::Route>,

    /// The token for the next page of the response. To see more results,
    /// use this value as the page_token for your next request. If this value
    /// is empty, there are no more results.
    pub next_page_token: std::string::String,

    /// RouteTables that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRoutesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [routes][crate::model::ListRoutesResponse::routes].
    pub fn set_routes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Route>,
    {
        use std::iter::Iterator;
        self.routes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListRoutesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListRoutesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListRoutesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRoutesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRoutesResponse {
    type PageItem = crate::model::Route;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.routes
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for
/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRouteTablesRequest {
    /// Required. The parent resource's name.
    pub parent: std::string::String,

    /// The maximum number of results to return per page.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// An expression that filters the list of results.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRouteTablesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListRouteTablesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListRouteTablesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListRouteTablesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListRouteTablesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListRouteTablesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListRouteTablesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"
    }
}

/// Response for
/// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListRouteTables]: crate::client::HubService::list_route_tables
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRouteTablesResponse {
    /// The requested route tables.
    pub route_tables: std::vec::Vec<crate::model::RouteTable>,

    /// The token for the next page of the response. To see more results,
    /// use this value as the page_token for your next request. If this value
    /// is empty, there are no more results.
    pub next_page_token: std::string::String,

    /// Hubs that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListRouteTablesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [route_tables][crate::model::ListRouteTablesResponse::route_tables].
    pub fn set_route_tables<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::RouteTable>,
    {
        use std::iter::Iterator;
        self.route_tables = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListRouteTablesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListRouteTablesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListRouteTablesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListRouteTablesResponse {
    type PageItem = crate::model::RouteTable;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.route_tables
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for
/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGroupsRequest {
    /// Required. The parent resource's name.
    pub parent: std::string::String,

    /// The maximum number of results to return per page.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// An expression that filters the list of results.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListGroupsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListGroupsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListGroupsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListGroupsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListGroupsRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListGroupsRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListGroupsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsRequest"
    }
}

/// Response for
/// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.ListGroups]: crate::client::HubService::list_groups
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListGroupsResponse {
    /// The requested groups.
    pub groups: std::vec::Vec<crate::model::Group>,

    /// The token for the next page of the response. To see more results,
    /// use this value as the page_token for your next request. If this value
    /// is empty, there are no more results.
    pub next_page_token: std::string::String,

    /// Hubs that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListGroupsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [groups][crate::model::ListGroupsResponse::groups].
    pub fn set_groups<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Group>,
    {
        use std::iter::Iterator;
        self.groups = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListGroupsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListGroupsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListGroupsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListGroupsResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListGroupsResponse {
    type PageItem = crate::model::Group;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.groups
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// A collection of Cloud VPN tunnel resources. These resources should be
/// redundant HA VPN tunnels that all advertise the same prefixes to Google
/// Cloud. Alternatively, in a passive/active configuration, all tunnels
/// should be capable of advertising the same prefixes.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedVpnTunnels {
    /// The URIs of linked VPN tunnel resources.
    pub uris: std::vec::Vec<std::string::String>,

    /// A value that controls whether site-to-site data transfer is enabled for
    /// these resources. Data transfer is available only in [supported
    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
    pub site_to_site_data_transfer: bool,

    /// Output only. The VPC network where these VPN tunnels are located.
    pub vpc_network: std::string::String,

    /// Optional. IP ranges allowed to be included during import from hub (does not
    /// control transit connectivity). The only allowed value for now is
    /// "ALL_IPV4_RANGES".
    pub include_import_ranges: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LinkedVpnTunnels {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uris][crate::model::LinkedVpnTunnels::uris].
    pub fn set_uris<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.uris = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedVpnTunnels::site_to_site_data_transfer].
    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.site_to_site_data_transfer = v.into();
        self
    }

    /// Sets the value of [vpc_network][crate::model::LinkedVpnTunnels::vpc_network].
    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.vpc_network = v.into();
        self
    }

    /// Sets the value of [include_import_ranges][crate::model::LinkedVpnTunnels::include_import_ranges].
    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LinkedVpnTunnels {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"
    }
}

/// A collection of VLAN attachment resources. These resources should
/// be redundant attachments that all advertise the same prefixes to Google
/// Cloud. Alternatively, in active/passive configurations, all attachments
/// should be capable of advertising the same prefixes.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedInterconnectAttachments {
    /// The URIs of linked interconnect attachment resources
    pub uris: std::vec::Vec<std::string::String>,

    /// A value that controls whether site-to-site data transfer is enabled for
    /// these resources. Data transfer is available only in [supported
    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
    pub site_to_site_data_transfer: bool,

    /// Output only. The VPC network where these VLAN attachments are located.
    pub vpc_network: std::string::String,

    /// Optional. IP ranges allowed to be included during import from hub (does not
    /// control transit connectivity). The only allowed value for now is
    /// "ALL_IPV4_RANGES".
    pub include_import_ranges: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LinkedInterconnectAttachments {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uris][crate::model::LinkedInterconnectAttachments::uris].
    pub fn set_uris<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.uris = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedInterconnectAttachments::site_to_site_data_transfer].
    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.site_to_site_data_transfer = v.into();
        self
    }

    /// Sets the value of [vpc_network][crate::model::LinkedInterconnectAttachments::vpc_network].
    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.vpc_network = v.into();
        self
    }

    /// Sets the value of [include_import_ranges][crate::model::LinkedInterconnectAttachments::include_import_ranges].
    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LinkedInterconnectAttachments {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"
    }
}

/// A collection of router appliance instances. If you configure multiple router
/// appliance instances to receive data from the same set of sites outside of
/// Google Cloud, we recommend that you associate those instances with the same
/// spoke.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedRouterApplianceInstances {
    /// The list of router appliance instances.
    pub instances: std::vec::Vec<crate::model::RouterApplianceInstance>,

    /// A value that controls whether site-to-site data transfer is enabled for
    /// these resources. Data transfer is available only in [supported
    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
    pub site_to_site_data_transfer: bool,

    /// Output only. The VPC network where these router appliance instances are
    /// located.
    pub vpc_network: std::string::String,

    /// Optional. IP ranges allowed to be included during import from hub (does not
    /// control transit connectivity). The only allowed value for now is
    /// "ALL_IPV4_RANGES".
    pub include_import_ranges: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LinkedRouterApplianceInstances {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [instances][crate::model::LinkedRouterApplianceInstances::instances].
    pub fn set_instances<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::RouterApplianceInstance>,
    {
        use std::iter::Iterator;
        self.instances = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [site_to_site_data_transfer][crate::model::LinkedRouterApplianceInstances::site_to_site_data_transfer].
    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.site_to_site_data_transfer = v.into();
        self
    }

    /// Sets the value of [vpc_network][crate::model::LinkedRouterApplianceInstances::vpc_network].
    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.vpc_network = v.into();
        self
    }

    /// Sets the value of [include_import_ranges][crate::model::LinkedRouterApplianceInstances::include_import_ranges].
    pub fn set_include_import_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.include_import_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LinkedRouterApplianceInstances {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"
    }
}

/// An existing VPC network.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedVpcNetwork {
    /// Required. The URI of the VPC network resource.
    pub uri: std::string::String,

    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
    pub exclude_export_ranges: std::vec::Vec<std::string::String>,

    /// Optional. IP ranges allowed to be included from peering.
    pub include_export_ranges: std::vec::Vec<std::string::String>,

    /// Optional. The proposed include export IP ranges waiting for hub
    /// administration's approval.
    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,

    /// Output only. The proposed exclude export IP ranges waiting for hub
    /// administration's approval.
    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,

    /// Output only. The list of Producer VPC spokes that this VPC spoke is a
    /// service consumer VPC spoke for. These producer VPCs are connected through
    /// VPC peering to this spoke's backing VPC network. Because they are directly
    /// connected throuh VPC peering, NCC export filters do not apply between the
    /// service consumer VPC spoke and any of its producer VPC spokes. This VPC
    /// spoke cannot be deleted as long as any of these producer VPC spokes are
    /// connected to the NCC Hub.
    pub producer_vpc_spokes: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LinkedVpcNetwork {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::LinkedVpcNetwork::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [exclude_export_ranges][crate::model::LinkedVpcNetwork::exclude_export_ranges].
    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [include_export_ranges][crate::model::LinkedVpcNetwork::include_export_ranges].
    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedVpcNetwork::proposed_include_export_ranges].
    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedVpcNetwork::proposed_exclude_export_ranges].
    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [producer_vpc_spokes][crate::model::LinkedVpcNetwork::producer_vpc_spokes].
    pub fn set_producer_vpc_spokes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.producer_vpc_spokes = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LinkedVpcNetwork {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkedProducerVpcNetwork {
    /// Immutable. The URI of the Service Consumer VPC that the Producer VPC is
    /// peered with.
    pub network: std::string::String,

    /// Output only. The Service Consumer Network spoke.
    pub service_consumer_vpc_spoke: std::string::String,

    /// Immutable. The name of the VPC peering between the Service Consumer VPC and
    /// the Producer VPC (defined in the Tenant project) which is added to the NCC
    /// hub. This peering must be in ACTIVE state.
    pub peering: std::string::String,

    /// Output only. The URI of the Producer VPC.
    pub producer_network: std::string::String,

    /// Optional. IP ranges encompassing the subnets to be excluded from peering.
    pub exclude_export_ranges: std::vec::Vec<std::string::String>,

    /// Optional. IP ranges allowed to be included from peering.
    pub include_export_ranges: std::vec::Vec<std::string::String>,

    /// Optional. The proposed include export IP ranges waiting for hub
    /// administration's approval.
    pub proposed_include_export_ranges: std::vec::Vec<std::string::String>,

    /// Output only. The proposed exclude export IP ranges waiting for hub
    /// administration's approval.
    pub proposed_exclude_export_ranges: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LinkedProducerVpcNetwork {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [network][crate::model::LinkedProducerVpcNetwork::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [service_consumer_vpc_spoke][crate::model::LinkedProducerVpcNetwork::service_consumer_vpc_spoke].
    pub fn set_service_consumer_vpc_spoke<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.service_consumer_vpc_spoke = v.into();
        self
    }

    /// Sets the value of [peering][crate::model::LinkedProducerVpcNetwork::peering].
    pub fn set_peering<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.peering = v.into();
        self
    }

    /// Sets the value of [producer_network][crate::model::LinkedProducerVpcNetwork::producer_network].
    pub fn set_producer_network<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.producer_network = v.into();
        self
    }

    /// Sets the value of [exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::exclude_export_ranges].
    pub fn set_exclude_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [include_export_ranges][crate::model::LinkedProducerVpcNetwork::include_export_ranges].
    pub fn set_include_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.include_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [proposed_include_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_include_export_ranges].
    pub fn set_proposed_include_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.proposed_include_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [proposed_exclude_export_ranges][crate::model::LinkedProducerVpcNetwork::proposed_exclude_export_ranges].
    pub fn set_proposed_exclude_export_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.proposed_exclude_export_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LinkedProducerVpcNetwork {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.LinkedProducerVpcNetwork"
    }
}

/// A router appliance instance is a Compute Engine virtual machine (VM) instance
/// that acts as a BGP speaker. A router appliance instance is specified by the
/// URI of the VM and the internal IP address of one of the VM's network
/// interfaces.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RouterApplianceInstance {
    /// The URI of the VM.
    pub virtual_machine: std::string::String,

    /// The IP address on the VM to use for peering.
    pub ip_address: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RouterApplianceInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [virtual_machine][crate::model::RouterApplianceInstance::virtual_machine].
    pub fn set_virtual_machine<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.virtual_machine = v.into();
        self
    }

    /// Sets the value of [ip_address][crate::model::RouterApplianceInstance::ip_address].
    pub fn set_ip_address<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.ip_address = v.into();
        self
    }
}

impl wkt::message::Message for RouterApplianceInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.RouterApplianceInstance"
    }
}

/// Metadata about locations
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationMetadata {
    /// List of supported features
    pub location_features: std::vec::Vec<crate::model::LocationFeature>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LocationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [location_features][crate::model::LocationMetadata::location_features].
    pub fn set_location_features<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::LocationFeature>,
    {
        use std::iter::Iterator;
        self.location_features = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LocationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.LocationMetadata"
    }
}

#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopVpcNetwork {
    /// The URI of the VPC network resource
    pub uri: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NextHopVpcNetwork {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::NextHopVpcNetwork::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }
}

impl wkt::message::Message for NextHopVpcNetwork {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"
    }
}

/// A route next hop that leads to a VPN tunnel resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopVPNTunnel {
    /// The URI of the VPN tunnel resource.
    pub uri: std::string::String,

    /// The VPC network where this VPN tunnel is located.
    pub vpc_network: std::string::String,

    /// Indicates whether site-to-site data transfer is allowed for this VPN tunnel
    /// resource. Data transfer is available only in [supported
    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
    pub site_to_site_data_transfer: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NextHopVPNTunnel {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::NextHopVPNTunnel::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [vpc_network][crate::model::NextHopVPNTunnel::vpc_network].
    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.vpc_network = v.into();
        self
    }

    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopVPNTunnel::site_to_site_data_transfer].
    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.site_to_site_data_transfer = v.into();
        self
    }
}

impl wkt::message::Message for NextHopVPNTunnel {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopVPNTunnel"
    }
}

/// A route next hop that leads to a Router appliance instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopRouterApplianceInstance {
    /// The URI of the Router appliance instance.
    pub uri: std::string::String,

    /// The VPC network where this VM is located.
    pub vpc_network: std::string::String,

    /// Indicates whether site-to-site data transfer is allowed for this Router
    /// appliance instance resource. Data transfer is available only in [supported
    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
    pub site_to_site_data_transfer: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NextHopRouterApplianceInstance {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::NextHopRouterApplianceInstance::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [vpc_network][crate::model::NextHopRouterApplianceInstance::vpc_network].
    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.vpc_network = v.into();
        self
    }

    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopRouterApplianceInstance::site_to_site_data_transfer].
    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.site_to_site_data_transfer = v.into();
        self
    }
}

impl wkt::message::Message for NextHopRouterApplianceInstance {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance"
    }
}

/// A route next hop that leads to an interconnect attachment resource.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct NextHopInterconnectAttachment {
    /// The URI of the interconnect attachment resource.
    pub uri: std::string::String,

    /// The VPC network where this interconnect attachment is located.
    pub vpc_network: std::string::String,

    /// Indicates whether site-to-site data transfer is allowed for this
    /// interconnect attachment resource. Data transfer is available only in
    /// [supported
    /// locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations).
    pub site_to_site_data_transfer: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl NextHopInterconnectAttachment {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [uri][crate::model::NextHopInterconnectAttachment::uri].
    pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.uri = v.into();
        self
    }

    /// Sets the value of [vpc_network][crate::model::NextHopInterconnectAttachment::vpc_network].
    pub fn set_vpc_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.vpc_network = v.into();
        self
    }

    /// Sets the value of [site_to_site_data_transfer][crate::model::NextHopInterconnectAttachment::site_to_site_data_transfer].
    pub fn set_site_to_site_data_transfer<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.site_to_site_data_transfer = v.into();
        self
    }
}

impl wkt::message::Message for NextHopInterconnectAttachment {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.NextHopInterconnectAttachment"
    }
}

/// Summarizes information about the spokes associated with a hub.
/// The summary includes a count of spokes according to type
/// and according to state. If any spokes are inactive,
/// the summary also lists the reasons they are inactive,
/// including a count for each reason.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpokeSummary {
    /// Output only. Counts the number of spokes of each type that are
    /// associated with a specific hub.
    pub spoke_type_counts: std::vec::Vec<crate::model::spoke_summary::SpokeTypeCount>,

    /// Output only. Counts the number of spokes that are in each state
    /// and associated with a given hub.
    pub spoke_state_counts: std::vec::Vec<crate::model::spoke_summary::SpokeStateCount>,

    /// Output only. Counts the number of spokes that are inactive for each
    /// possible reason and associated with a given hub.
    pub spoke_state_reason_counts:
        std::vec::Vec<crate::model::spoke_summary::SpokeStateReasonCount>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl SpokeSummary {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [spoke_type_counts][crate::model::SpokeSummary::spoke_type_counts].
    pub fn set_spoke_type_counts<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::spoke_summary::SpokeTypeCount>,
    {
        use std::iter::Iterator;
        self.spoke_type_counts = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [spoke_state_counts][crate::model::SpokeSummary::spoke_state_counts].
    pub fn set_spoke_state_counts<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::spoke_summary::SpokeStateCount>,
    {
        use std::iter::Iterator;
        self.spoke_state_counts = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [spoke_state_reason_counts][crate::model::SpokeSummary::spoke_state_reason_counts].
    pub fn set_spoke_state_reason_counts<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::spoke_summary::SpokeStateReasonCount>,
    {
        use std::iter::Iterator;
        self.spoke_state_reason_counts = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for SpokeSummary {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary"
    }
}

/// Defines additional types related to [SpokeSummary].
pub mod spoke_summary {
    #[allow(unused_imports)]
    use super::*;

    /// The number of spokes of a given type that are associated
    /// with a specific hub. The type indicates what kind of
    /// resource is associated with the spoke.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SpokeTypeCount {
        /// Output only. The type of the spokes.
        pub spoke_type: crate::model::SpokeType,

        /// Output only. The total number of spokes of this type that are
        /// associated with the hub.
        pub count: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SpokeTypeCount {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [spoke_type][crate::model::spoke_summary::SpokeTypeCount::spoke_type].
        pub fn set_spoke_type<T: std::convert::Into<crate::model::SpokeType>>(
            mut self,
            v: T,
        ) -> Self {
            self.spoke_type = v.into();
            self
        }

        /// Sets the value of [count][crate::model::spoke_summary::SpokeTypeCount::count].
        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.count = v.into();
            self
        }
    }

    impl wkt::message::Message for SpokeTypeCount {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"
        }
    }

    /// The number of spokes that are in a particular state
    /// and associated with a given hub.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SpokeStateCount {
        /// Output only. The state of the spokes.
        pub state: crate::model::State,

        /// Output only. The total number of spokes that are in this state
        /// and associated with a given hub.
        pub count: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SpokeStateCount {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [state][crate::model::spoke_summary::SpokeStateCount::state].
        pub fn set_state<T: std::convert::Into<crate::model::State>>(mut self, v: T) -> Self {
            self.state = v.into();
            self
        }

        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateCount::count].
        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.count = v.into();
            self
        }
    }

    impl wkt::message::Message for SpokeStateCount {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"
        }
    }

    /// The number of spokes in the hub that are inactive for this reason.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct SpokeStateReasonCount {
        /// Output only. The reason that a spoke is inactive.
        pub state_reason_code: crate::model::spoke::state_reason::Code,

        /// Output only. The total number of spokes that are inactive for a
        /// particular reason and associated with a given hub.
        pub count: i64,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl SpokeStateReasonCount {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [state_reason_code][crate::model::spoke_summary::SpokeStateReasonCount::state_reason_code].
        pub fn set_state_reason_code<
            T: std::convert::Into<crate::model::spoke::state_reason::Code>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.state_reason_code = v.into();
            self
        }

        /// Sets the value of [count][crate::model::spoke_summary::SpokeStateReasonCount::count].
        pub fn set_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
            self.count = v.into();
            self
        }
    }

    impl wkt::message::Message for SpokeStateReasonCount {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"
        }
    }
}

/// The request for
/// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup].
///
/// [google.cloud.networkconnectivity.v1.HubService.GetGroup]: crate::client::HubService::get_group
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetGroupRequest {
    /// Required. The name of the route table resource.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetGroupRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetGroupRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetGroupRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetGroupRequest"
    }
}

/// Request for
/// [HubService.UpdateGroup][google.cloud.networkconnectivity.v1.HubService.UpdateGroup]
/// method.
///
/// [google.cloud.networkconnectivity.v1.HubService.UpdateGroup]: crate::client::HubService::update_group
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateGroupRequest {
    /// Optional. In the case of an update to an existing group, field mask is used
    /// to specify the fields to be overwritten. The fields specified in the
    /// update_mask are relative to the resource, not the full request. A field is
    /// overwritten if it is in the mask. If the user does not provide a mask, then
    /// all fields are overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. The state that the group should be in after the update.
    pub group: std::option::Option<crate::model::Group>,

    /// Optional. A request ID to identify requests. Specify a unique request ID so
    /// that if you must retry your request, the server knows to ignore the request
    /// if it has already been completed. The server guarantees that a request
    /// doesn't result in creation of duplicate commitments for at least 60
    /// minutes.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check to see whether the original operation
    /// was received. If it was, the server ignores the second request. This
    /// behavior prevents clients from mistakenly creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID, with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateGroupRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateGroupRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [group][crate::model::UpdateGroupRequest::group].
    pub fn set_group<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Group>,
    {
        self.group = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [group][crate::model::UpdateGroupRequest::group].
    pub fn set_or_clear_group<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Group>,
    {
        self.group = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateGroupRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateGroupRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateGroupRequest"
    }
}

/// The internal range resource for IPAM operations within a VPC network.
/// Used to represent a private address range along with behavioral
/// characteristics of that range (its usage and peering behavior).
/// Networking resources can link to this range if they are created
/// as belonging to it.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InternalRange {
    /// Identifier. The name of an internal range.
    /// Format:
    /// projects/{project}/locations/{location}/internalRanges/{internal_range}
    /// See: <https://google.aip.dev/122#fields-representing-resource-names>
    pub name: std::string::String,

    /// Time when the internal range was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Time when the internal range was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. A description of this resource.
    pub description: std::string::String,

    /// Optional. The IP range that this internal range defines.
    /// NOTE: IPv6 ranges are limited to usage=EXTERNAL_TO_VPC and
    /// peering=FOR_SELF.
    /// NOTE: For IPv6 Ranges this field is compulsory, i.e. the address range must
    /// be specified explicitly.
    pub ip_cidr_range: std::string::String,

    /// Immutable. The URL or resource ID of the network in which to reserve the
    /// internal range. The network cannot be deleted if there are any reserved
    /// internal ranges referring to it. Legacy networks are not supported. For
    /// example:
    /// <https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network}>
    /// projects/{project}/locations/global/networks/{network}
    /// {network}
    pub network: std::string::String,

    /// Optional. The type of usage set for this InternalRange.
    pub usage: crate::model::internal_range::Usage,

    /// Optional. The type of peering set for this internal range.
    pub peering: crate::model::internal_range::Peering,

    /// Optional. An alternate to ip_cidr_range. Can be set when trying to create
    /// an IPv4 reservation that automatically finds a free range of the given
    /// size. If both ip_cidr_range and prefix_length are set, there is an error if
    /// the range sizes do not match. Can also be used during updates to change the
    /// range size.
    /// NOTE: For IPv6 this field only works if ip_cidr_range is set as well, and
    /// both fields must match. In other words, with IPv6 this field only works as
    /// a redundant parameter.
    pub prefix_length: i32,

    /// Optional. Can be set to narrow down or pick a different address space while
    /// searching for a free range. If not set, defaults to the "10.0.0.0/8"
    /// address space. This can be used to search in other rfc-1918 address
    /// spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918
    /// address spaces used in the VPC.
    pub target_cidr_range: std::vec::Vec<std::string::String>,

    /// Output only. The list of resources that refer to this internal range.
    /// Resources that use the internal range for their range allocation
    /// are referred to as users of the range. Other resources mark themselves
    /// as users while doing so by creating a reference to this internal range.
    /// Having a user, based on this reference, prevents deletion of the
    /// internal range referred to. Can be empty.
    pub users: std::vec::Vec<std::string::String>,

    /// Optional. Types of resources that are allowed to overlap with the current
    /// internal range.
    pub overlaps: std::vec::Vec<crate::model::internal_range::Overlap>,

    /// Optional. Must be present if usage is set to FOR_MIGRATION.
    pub migration: std::option::Option<crate::model::internal_range::Migration>,

    /// Optional. Immutable ranges cannot have their fields modified, except for
    /// labels and description.
    pub immutable: bool,

    /// Optional. Range auto-allocation options, may be set only when
    /// auto-allocation is selected by not setting ip_cidr_range (and setting
    /// prefix_length).
    pub allocation_options: std::option::Option<crate::model::internal_range::AllocationOptions>,

    /// Optional. ExcludeCidrRanges flag. Specifies a set of CIDR blocks that
    /// allows exclusion of particular CIDR ranges from the auto-allocation
    /// process, without having to reserve these blocks
    pub exclude_cidr_ranges: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl InternalRange {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::InternalRange::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::InternalRange::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::InternalRange::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::InternalRange::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::InternalRange::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::InternalRange::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::InternalRange::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [ip_cidr_range][crate::model::InternalRange::ip_cidr_range].
    pub fn set_ip_cidr_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.ip_cidr_range = v.into();
        self
    }

    /// Sets the value of [network][crate::model::InternalRange::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [usage][crate::model::InternalRange::usage].
    pub fn set_usage<T: std::convert::Into<crate::model::internal_range::Usage>>(
        mut self,
        v: T,
    ) -> Self {
        self.usage = v.into();
        self
    }

    /// Sets the value of [peering][crate::model::InternalRange::peering].
    pub fn set_peering<T: std::convert::Into<crate::model::internal_range::Peering>>(
        mut self,
        v: T,
    ) -> Self {
        self.peering = v.into();
        self
    }

    /// Sets the value of [prefix_length][crate::model::InternalRange::prefix_length].
    pub fn set_prefix_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.prefix_length = v.into();
        self
    }

    /// Sets the value of [target_cidr_range][crate::model::InternalRange::target_cidr_range].
    pub fn set_target_cidr_range<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.target_cidr_range = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [users][crate::model::InternalRange::users].
    pub fn set_users<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.users = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [overlaps][crate::model::InternalRange::overlaps].
    pub fn set_overlaps<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::internal_range::Overlap>,
    {
        use std::iter::Iterator;
        self.overlaps = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [migration][crate::model::InternalRange::migration].
    pub fn set_migration<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::internal_range::Migration>,
    {
        self.migration = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [migration][crate::model::InternalRange::migration].
    pub fn set_or_clear_migration<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::internal_range::Migration>,
    {
        self.migration = v.map(|x| x.into());
        self
    }

    /// Sets the value of [immutable][crate::model::InternalRange::immutable].
    pub fn set_immutable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.immutable = v.into();
        self
    }

    /// Sets the value of [allocation_options][crate::model::InternalRange::allocation_options].
    pub fn set_allocation_options<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
    {
        self.allocation_options = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [allocation_options][crate::model::InternalRange::allocation_options].
    pub fn set_or_clear_allocation_options<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::internal_range::AllocationOptions>,
    {
        self.allocation_options = v.map(|x| x.into());
        self
    }

    /// Sets the value of [exclude_cidr_ranges][crate::model::InternalRange::exclude_cidr_ranges].
    pub fn set_exclude_cidr_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.exclude_cidr_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for InternalRange {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange"
    }
}

/// Defines additional types related to [InternalRange].
pub mod internal_range {
    #[allow(unused_imports)]
    use super::*;

    /// Specification for migration with source and target resource names.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Migration {
        /// Immutable. Resource path as an URI of the source resource, for example a
        /// subnet. The project for the source resource should match the project for
        /// the InternalRange. An example:
        /// /projects/{project}/regions/{region}/subnetworks/{subnet}
        pub source: std::string::String,

        /// Immutable. Resource path of the target resource. The target project can
        /// be different, as in the cases when migrating to peer networks. For
        /// example:
        /// /projects/{project}/regions/{region}/subnetworks/{subnet}
        pub target: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Migration {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [source][crate::model::internal_range::Migration::source].
        pub fn set_source<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.source = v.into();
            self
        }

        /// Sets the value of [target][crate::model::internal_range::Migration::target].
        pub fn set_target<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.target = v.into();
            self
        }
    }

    impl wkt::message::Message for Migration {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.Migration"
        }
    }

    /// Range auto-allocation options, to be optionally used when CIDR block is not
    /// explicitly set.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct AllocationOptions {
        /// Optional. Allocation strategy Not setting this field when the allocation
        /// is requested means an implementation defined strategy is used.
        pub allocation_strategy: crate::model::internal_range::AllocationStrategy,

        /// Optional. This field must be set only when allocation_strategy is set to
        /// RANDOM_FIRST_N_AVAILABLE.
        /// The value should be the maximum expected parallelism of range creation
        /// requests issued to the same space of peered netwroks.
        pub first_available_ranges_lookup_size: i32,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl AllocationOptions {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [allocation_strategy][crate::model::internal_range::AllocationOptions::allocation_strategy].
        pub fn set_allocation_strategy<
            T: std::convert::Into<crate::model::internal_range::AllocationStrategy>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.allocation_strategy = v.into();
            self
        }

        /// Sets the value of [first_available_ranges_lookup_size][crate::model::internal_range::AllocationOptions::first_available_ranges_lookup_size].
        pub fn set_first_available_ranges_lookup_size<T: std::convert::Into<i32>>(
            mut self,
            v: T,
        ) -> Self {
            self.first_available_ranges_lookup_size = v.into();
            self
        }
    }

    impl wkt::message::Message for AllocationOptions {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.InternalRange.AllocationOptions"
        }
    }

    /// Possible usage of an internal range.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Usage {
        /// Unspecified usage is allowed in calls which identify the resource by
        /// other fields and do not need Usage set to complete. These are, i.e.:
        /// GetInternalRange and DeleteInternalRange.
        /// Usage needs to be specified explicitly in CreateInternalRange
        /// or UpdateInternalRange calls.
        Unspecified,
        /// A VPC resource can use the reserved CIDR block by associating it with the
        /// internal range resource if usage is set to FOR_VPC.
        ForVpc,
        /// Ranges created with EXTERNAL_TO_VPC cannot be associated with VPC
        /// resources and are meant to block out address ranges for various use
        /// cases, like for example, usage on-prem, with dynamic route announcements
        /// via interconnect.
        ExternalToVpc,
        /// Ranges created FOR_MIGRATION can be used to lock a CIDR range between a
        /// source and target subnet. If usage is set to FOR_MIGRATION, the peering
        /// value has to be set to FOR_SELF or default to FOR_SELF when unset.
        ForMigration,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Usage::value] or
        /// [Usage::name].
        UnknownValue(usage::UnknownValue),
    }

    #[doc(hidden)]
    pub mod usage {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Usage {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::ForVpc => std::option::Option::Some(1),
                Self::ExternalToVpc => std::option::Option::Some(2),
                Self::ForMigration => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("USAGE_UNSPECIFIED"),
                Self::ForVpc => std::option::Option::Some("FOR_VPC"),
                Self::ExternalToVpc => std::option::Option::Some("EXTERNAL_TO_VPC"),
                Self::ForMigration => std::option::Option::Some("FOR_MIGRATION"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Usage {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Usage {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Usage {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::ForVpc,
                2 => Self::ExternalToVpc,
                3 => Self::ForMigration,
                _ => Self::UnknownValue(usage::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Usage {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "USAGE_UNSPECIFIED" => Self::Unspecified,
                "FOR_VPC" => Self::ForVpc,
                "EXTERNAL_TO_VPC" => Self::ExternalToVpc,
                "FOR_MIGRATION" => Self::ForMigration,
                _ => Self::UnknownValue(usage::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Usage {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::ForVpc => serializer.serialize_i32(1),
                Self::ExternalToVpc => serializer.serialize_i32(2),
                Self::ForMigration => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Usage {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Usage>::new(
                ".google.cloud.networkconnectivity.v1.InternalRange.Usage",
            ))
        }
    }

    /// Peering type.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Peering {
        /// If Peering is left unspecified in CreateInternalRange or
        /// UpdateInternalRange, it will be defaulted to FOR_SELF.
        Unspecified,
        /// This is the default behavior and represents the case that this
        /// internal range is intended to be used in the VPC in which it is created
        /// and is accessible from its peers. This implies that peers or
        /// peers-of-peers cannot use this range.
        ForSelf,
        /// This behavior can be set when the internal range is being reserved for
        /// usage by peers. This means that no resource within the VPC in which
        /// it is being created can use this to associate with a VPC resource, but
        /// one of the peers can. This represents donating a range for peers to
        /// use.
        ForPeer,
        /// This behavior can be set when the internal range is being reserved for
        /// usage by the VPC in which it is created, but not shared with peers.
        /// In a sense, it is local to the VPC. This can be used to create internal
        /// ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
        /// Interconnect routes that are not shared with peers. This also implies
        /// that peers cannot use this range in a way that is visible to this VPC,
        /// but can re-use this range as long as it is NOT_SHARED from the peer VPC,
        /// too.
        NotShared,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Peering::value] or
        /// [Peering::name].
        UnknownValue(peering::UnknownValue),
    }

    #[doc(hidden)]
    pub mod peering {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Peering {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::ForSelf => std::option::Option::Some(1),
                Self::ForPeer => std::option::Option::Some(2),
                Self::NotShared => std::option::Option::Some(3),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("PEERING_UNSPECIFIED"),
                Self::ForSelf => std::option::Option::Some("FOR_SELF"),
                Self::ForPeer => std::option::Option::Some("FOR_PEER"),
                Self::NotShared => std::option::Option::Some("NOT_SHARED"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Peering {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Peering {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Peering {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::ForSelf,
                2 => Self::ForPeer,
                3 => Self::NotShared,
                _ => Self::UnknownValue(peering::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Peering {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "PEERING_UNSPECIFIED" => Self::Unspecified,
                "FOR_SELF" => Self::ForSelf,
                "FOR_PEER" => Self::ForPeer,
                "NOT_SHARED" => Self::NotShared,
                _ => Self::UnknownValue(peering::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Peering {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::ForSelf => serializer.serialize_i32(1),
                Self::ForPeer => serializer.serialize_i32(2),
                Self::NotShared => serializer.serialize_i32(3),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Peering {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Peering>::new(
                ".google.cloud.networkconnectivity.v1.InternalRange.Peering",
            ))
        }
    }

    /// Overlap specifications.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Overlap {
        /// No overlap overrides.
        Unspecified,
        /// Allow creation of static routes more specific that the current
        /// internal range.
        RouteRange,
        /// Allow creation of internal ranges that overlap with existing subnets.
        ExistingSubnetRange,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [Overlap::value] or
        /// [Overlap::name].
        UnknownValue(overlap::UnknownValue),
    }

    #[doc(hidden)]
    pub mod overlap {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl Overlap {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::RouteRange => std::option::Option::Some(1),
                Self::ExistingSubnetRange => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("OVERLAP_UNSPECIFIED"),
                Self::RouteRange => std::option::Option::Some("OVERLAP_ROUTE_RANGE"),
                Self::ExistingSubnetRange => {
                    std::option::Option::Some("OVERLAP_EXISTING_SUBNET_RANGE")
                }
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for Overlap {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for Overlap {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for Overlap {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::RouteRange,
                2 => Self::ExistingSubnetRange,
                _ => Self::UnknownValue(overlap::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for Overlap {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "OVERLAP_UNSPECIFIED" => Self::Unspecified,
                "OVERLAP_ROUTE_RANGE" => Self::RouteRange,
                "OVERLAP_EXISTING_SUBNET_RANGE" => Self::ExistingSubnetRange,
                _ => Self::UnknownValue(overlap::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for Overlap {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::RouteRange => serializer.serialize_i32(1),
                Self::ExistingSubnetRange => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for Overlap {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Overlap>::new(
                ".google.cloud.networkconnectivity.v1.InternalRange.Overlap",
            ))
        }
    }

    /// Enumeration of range auto-allocation strategies
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum AllocationStrategy {
        /// Unspecified is the only valid option when the range is specified
        /// explicitly by ip_cidr_range field. Otherwise unspefified means using the
        /// default strategy.
        Unspecified,
        /// Random strategy, the legacy algorithm, used for backwards compatibility.
        /// This allocation strategy remains efficient in the case of concurrent
        /// allocation requests in the same peered network space and doesn't require
        /// providing the level of concurrency in an explicit parameter, but it is
        /// prone to fragmenting available address space.
        Random,
        /// Pick the first available address range. This strategy is deterministic
        /// and the result is easy to predict.
        FirstAvailable,
        /// Pick an arbitrary range out of the first N available ones. The N will be
        /// set in the first_available_ranges_lookup_size field. This strategy should
        /// be used when concurrent allocation requests are made in the same space of
        /// peered networks while the fragmentation of the addrress space is reduced.
        RandomFirstNAvailable,
        /// Pick the smallest but fitting available range. This deterministic
        /// strategy minimizes fragmentation of the address space.
        FirstSmallestFitting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [AllocationStrategy::value] or
        /// [AllocationStrategy::name].
        UnknownValue(allocation_strategy::UnknownValue),
    }

    #[doc(hidden)]
    pub mod allocation_strategy {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl AllocationStrategy {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Random => std::option::Option::Some(1),
                Self::FirstAvailable => std::option::Option::Some(2),
                Self::RandomFirstNAvailable => std::option::Option::Some(3),
                Self::FirstSmallestFitting => std::option::Option::Some(4),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("ALLOCATION_STRATEGY_UNSPECIFIED"),
                Self::Random => std::option::Option::Some("RANDOM"),
                Self::FirstAvailable => std::option::Option::Some("FIRST_AVAILABLE"),
                Self::RandomFirstNAvailable => {
                    std::option::Option::Some("RANDOM_FIRST_N_AVAILABLE")
                }
                Self::FirstSmallestFitting => std::option::Option::Some("FIRST_SMALLEST_FITTING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for AllocationStrategy {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for AllocationStrategy {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for AllocationStrategy {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Random,
                2 => Self::FirstAvailable,
                3 => Self::RandomFirstNAvailable,
                4 => Self::FirstSmallestFitting,
                _ => Self::UnknownValue(allocation_strategy::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for AllocationStrategy {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "ALLOCATION_STRATEGY_UNSPECIFIED" => Self::Unspecified,
                "RANDOM" => Self::Random,
                "FIRST_AVAILABLE" => Self::FirstAvailable,
                "RANDOM_FIRST_N_AVAILABLE" => Self::RandomFirstNAvailable,
                "FIRST_SMALLEST_FITTING" => Self::FirstSmallestFitting,
                _ => Self::UnknownValue(allocation_strategy::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for AllocationStrategy {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Random => serializer.serialize_i32(1),
                Self::FirstAvailable => serializer.serialize_i32(2),
                Self::RandomFirstNAvailable => serializer.serialize_i32(3),
                Self::FirstSmallestFitting => serializer.serialize_i32(4),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for AllocationStrategy {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<AllocationStrategy>::new(
                ".google.cloud.networkconnectivity.v1.InternalRange.AllocationStrategy",
            ))
        }
    }
}

/// Request for InternalRangeService.ListInternalRanges
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInternalRangesRequest {
    /// Required. The parent resource's name.
    pub parent: std::string::String,

    /// The maximum number of results per page that should be returned.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// A filter expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInternalRangesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListInternalRangesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListInternalRangesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListInternalRangesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListInternalRangesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListInternalRangesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListInternalRangesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesRequest"
    }
}

/// Response for InternalRange.ListInternalRanges
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListInternalRangesResponse {
    /// Internal ranges to be returned.
    pub internal_ranges: std::vec::Vec<crate::model::InternalRange>,

    /// The next pagination token in the List response. It should be used as
    /// page_token for the following request. An empty value means no more result.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListInternalRangesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [internal_ranges][crate::model::ListInternalRangesResponse::internal_ranges].
    pub fn set_internal_ranges<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::InternalRange>,
    {
        use std::iter::Iterator;
        self.internal_ranges = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListInternalRangesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListInternalRangesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListInternalRangesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListInternalRangesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListInternalRangesResponse {
    type PageItem = crate::model::InternalRange;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.internal_ranges
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for InternalRangeService.GetInternalRange
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInternalRangeRequest {
    /// Required. Name of the InternalRange to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetInternalRangeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetInternalRangeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetInternalRangeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetInternalRangeRequest"
    }
}

/// Request for InternalRangeService.CreateInternalRange
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateInternalRangeRequest {
    /// Required. The parent resource's name of the internal range.
    pub parent: std::string::String,

    /// Optional. Resource ID
    /// (i.e. 'foo' in '[...]/projects/p/locations/l/internalRanges/foo')
    /// See <https://google.aip.dev/122#resource-id-segments>
    /// Unique per location.
    pub internal_range_id: std::string::String,

    /// Required. Initial values for a new internal range
    pub internal_range: std::option::Option<crate::model::InternalRange>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateInternalRangeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateInternalRangeRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [internal_range_id][crate::model::CreateInternalRangeRequest::internal_range_id].
    pub fn set_internal_range_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.internal_range_id = v.into();
        self
    }

    /// Sets the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
    pub fn set_internal_range<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InternalRange>,
    {
        self.internal_range = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_range][crate::model::CreateInternalRangeRequest::internal_range].
    pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InternalRange>,
    {
        self.internal_range = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateInternalRangeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateInternalRangeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreateInternalRangeRequest"
    }
}

/// Request for InternalRangeService.UpdateInternalRange
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateInternalRangeRequest {
    /// Optional. Field mask is used to specify the fields to be overwritten in the
    /// InternalRange resource by the update.
    /// The fields specified in the update_mask are relative to the resource, not
    /// the full request. A field will be overwritten if it is in the mask. If the
    /// user does not provide a mask then all fields will be overwritten.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Required. New values to be patched into the resource.
    pub internal_range: std::option::Option<crate::model::InternalRange>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateInternalRangeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateInternalRangeRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
    pub fn set_internal_range<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::InternalRange>,
    {
        self.internal_range = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [internal_range][crate::model::UpdateInternalRangeRequest::internal_range].
    pub fn set_or_clear_internal_range<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::InternalRange>,
    {
        self.internal_range = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateInternalRangeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateInternalRangeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.UpdateInternalRangeRequest"
    }
}

/// Request for InternalRangeService.DeleteInternalRange
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteInternalRangeRequest {
    /// Required. The name of the internal range to delete.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server will know to
    /// ignore the request if it has already been completed. The server will
    /// guarantee that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, will ignore the second request. This prevents
    /// clients from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteInternalRangeRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteInternalRangeRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteInternalRangeRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteInternalRangeRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeleteInternalRangeRequest"
    }
}

/// Policy-based routes route L4 network traffic based on not just destination IP
/// address, but also source IP address, protocol, and more. If a policy-based
/// route conflicts with other types of routes, the policy-based route always
/// takes precedence.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyBasedRoute {
    /// Immutable. A unique name of the resource in the form of
    /// `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}`
    pub name: std::string::String,

    /// Output only. Time when the policy-based route was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when the policy-based route was updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// User-defined labels.
    pub labels: std::collections::HashMap<std::string::String, std::string::String>,

    /// Optional. An optional description of this resource. Provide this field when
    /// you create the resource.
    pub description: std::string::String,

    /// Required. Fully-qualified URL of the network that this route applies to,
    /// for example: projects/my-project/global/networks/my-network.
    pub network: std::string::String,

    /// Required. The filter to match L4 traffic.
    pub filter: std::option::Option<crate::model::policy_based_route::Filter>,

    /// Optional. The priority of this policy-based route. Priority is used to
    /// break ties in cases where there are more than one matching policy-based
    /// routes found. In cases where multiple policy-based routes are matched, the
    /// one with the lowest-numbered priority value wins. The default value is
    /// 1000. The priority value must be from 1 to 65535, inclusive.
    pub priority: i32,

    /// Output only. If potential misconfigurations are detected for this route,
    /// this field will be populated with warning messages.
    pub warnings: std::vec::Vec<crate::model::policy_based_route::Warnings>,

    /// Output only. Server-defined fully-qualified URL for this resource.
    pub self_link: std::string::String,

    /// Output only. Type of this resource. Always
    /// networkconnectivity#policyBasedRoute for policy-based Route resources.
    pub kind: std::string::String,

    /// Target specifies network endpoints that this policy-based route applies to.
    /// If no target is specified, the PBR will be installed on all network
    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
    pub target: std::option::Option<crate::model::policy_based_route::Target>,

    pub next_hop: std::option::Option<crate::model::policy_based_route::NextHop>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PolicyBasedRoute {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PolicyBasedRoute::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::PolicyBasedRoute::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::PolicyBasedRoute::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::PolicyBasedRoute::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::PolicyBasedRoute::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [labels][crate::model::PolicyBasedRoute::labels].
    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [description][crate::model::PolicyBasedRoute::description].
    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.description = v.into();
        self
    }

    /// Sets the value of [network][crate::model::PolicyBasedRoute::network].
    pub fn set_network<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.network = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::PolicyBasedRoute::filter].
    pub fn set_filter<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::policy_based_route::Filter>,
    {
        self.filter = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [filter][crate::model::PolicyBasedRoute::filter].
    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::policy_based_route::Filter>,
    {
        self.filter = v.map(|x| x.into());
        self
    }

    /// Sets the value of [priority][crate::model::PolicyBasedRoute::priority].
    pub fn set_priority<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.priority = v.into();
        self
    }

    /// Sets the value of [warnings][crate::model::PolicyBasedRoute::warnings].
    pub fn set_warnings<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::policy_based_route::Warnings>,
    {
        use std::iter::Iterator;
        self.warnings = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [self_link][crate::model::PolicyBasedRoute::self_link].
    pub fn set_self_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.self_link = v.into();
        self
    }

    /// Sets the value of [kind][crate::model::PolicyBasedRoute::kind].
    pub fn set_kind<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.kind = v.into();
        self
    }

    /// Sets the value of [target][crate::model::PolicyBasedRoute::target].
    ///
    /// Note that all the setters affecting `target` are mutually
    /// exclusive.
    pub fn set_target<
        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::Target>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.target = v.into();
        self
    }

    /// The value of [target][crate::model::PolicyBasedRoute::target]
    /// if it holds a `VirtualMachine`, `None` if the field is not set or
    /// holds a different branch.
    pub fn virtual_machine(
        &self,
    ) -> std::option::Option<&std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>
    {
        #[allow(unreachable_patterns)]
        self.target.as_ref().and_then(|v| match v {
            crate::model::policy_based_route::Target::VirtualMachine(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
    /// to hold a `VirtualMachine`.
    ///
    /// Note that all the setters affecting `target` are
    /// mutually exclusive.
    pub fn set_virtual_machine<
        T: std::convert::Into<std::boxed::Box<crate::model::policy_based_route::VirtualMachine>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.target = std::option::Option::Some(
            crate::model::policy_based_route::Target::VirtualMachine(v.into()),
        );
        self
    }

    /// The value of [target][crate::model::PolicyBasedRoute::target]
    /// if it holds a `InterconnectAttachment`, `None` if the field is not set or
    /// holds a different branch.
    pub fn interconnect_attachment(
        &self,
    ) -> std::option::Option<
        &std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
    > {
        #[allow(unreachable_patterns)]
        self.target.as_ref().and_then(|v| match v {
            crate::model::policy_based_route::Target::InterconnectAttachment(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [target][crate::model::PolicyBasedRoute::target]
    /// to hold a `InterconnectAttachment`.
    ///
    /// Note that all the setters affecting `target` are
    /// mutually exclusive.
    pub fn set_interconnect_attachment<
        T: std::convert::Into<
                std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
            >,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.target = std::option::Option::Some(
            crate::model::policy_based_route::Target::InterconnectAttachment(v.into()),
        );
        self
    }

    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop].
    ///
    /// Note that all the setters affecting `next_hop` are mutually
    /// exclusive.
    pub fn set_next_hop<
        T: std::convert::Into<std::option::Option<crate::model::policy_based_route::NextHop>>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.next_hop = v.into();
        self
    }

    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
    /// if it holds a `NextHopIlbIp`, `None` if the field is not set or
    /// holds a different branch.
    pub fn next_hop_ilb_ip(&self) -> std::option::Option<&std::string::String> {
        #[allow(unreachable_patterns)]
        self.next_hop.as_ref().and_then(|v| match v {
            crate::model::policy_based_route::NextHop::NextHopIlbIp(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
    /// to hold a `NextHopIlbIp`.
    ///
    /// Note that all the setters affecting `next_hop` are
    /// mutually exclusive.
    pub fn set_next_hop_ilb_ip<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_hop = std::option::Option::Some(
            crate::model::policy_based_route::NextHop::NextHopIlbIp(v.into()),
        );
        self
    }

    /// The value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
    /// if it holds a `NextHopOtherRoutes`, `None` if the field is not set or
    /// holds a different branch.
    pub fn next_hop_other_routes(
        &self,
    ) -> std::option::Option<&crate::model::policy_based_route::OtherRoutes> {
        #[allow(unreachable_patterns)]
        self.next_hop.as_ref().and_then(|v| match v {
            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v) => {
                std::option::Option::Some(v)
            }
            _ => std::option::Option::None,
        })
    }

    /// Sets the value of [next_hop][crate::model::PolicyBasedRoute::next_hop]
    /// to hold a `NextHopOtherRoutes`.
    ///
    /// Note that all the setters affecting `next_hop` are
    /// mutually exclusive.
    pub fn set_next_hop_other_routes<
        T: std::convert::Into<crate::model::policy_based_route::OtherRoutes>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.next_hop = std::option::Option::Some(
            crate::model::policy_based_route::NextHop::NextHopOtherRoutes(v.into()),
        );
        self
    }
}

impl wkt::message::Message for PolicyBasedRoute {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute"
    }
}

/// Defines additional types related to [PolicyBasedRoute].
pub mod policy_based_route {
    #[allow(unused_imports)]
    use super::*;

    /// VM instances that this policy-based route applies to.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct VirtualMachine {
        /// Optional. A list of VM instance tags that this policy-based route applies
        /// to. VM instances that have ANY of tags specified here installs this PBR.
        pub tags: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl VirtualMachine {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [tags][crate::model::policy_based_route::VirtualMachine::tags].
        pub fn set_tags<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.tags = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for VirtualMachine {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine"
        }
    }

    /// InterconnectAttachment that this route applies to.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct InterconnectAttachment {
        /// Optional. Cloud region to install this policy-based route on interconnect
        /// attachment. Use `all` to install it on all interconnect attachments.
        pub region: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl InterconnectAttachment {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [region][crate::model::policy_based_route::InterconnectAttachment::region].
        pub fn set_region<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.region = v.into();
            self
        }
    }

    impl wkt::message::Message for InterconnectAttachment {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment"
        }
    }

    /// Filter matches L4 traffic.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Filter {
        /// Optional. The IP protocol that this policy-based route applies to. Valid
        /// values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'.
        pub ip_protocol: std::string::String,

        /// Optional. The source IP range of outgoing packets that this policy-based
        /// route applies to. Default is "0.0.0.0/0" if protocol version is IPv4.
        pub src_range: std::string::String,

        /// Optional. The destination IP range of outgoing packets that this
        /// policy-based route applies to. Default is "0.0.0.0/0" if protocol version
        /// is IPv4.
        pub dest_range: std::string::String,

        /// Required. Internet protocol versions this policy-based route applies to.
        /// For this version, only IPV4 is supported. IPV6 is supported in preview.
        pub protocol_version: crate::model::policy_based_route::filter::ProtocolVersion,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Filter {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [ip_protocol][crate::model::policy_based_route::Filter::ip_protocol].
        pub fn set_ip_protocol<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.ip_protocol = v.into();
            self
        }

        /// Sets the value of [src_range][crate::model::policy_based_route::Filter::src_range].
        pub fn set_src_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.src_range = v.into();
            self
        }

        /// Sets the value of [dest_range][crate::model::policy_based_route::Filter::dest_range].
        pub fn set_dest_range<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
            self.dest_range = v.into();
            self
        }

        /// Sets the value of [protocol_version][crate::model::policy_based_route::Filter::protocol_version].
        pub fn set_protocol_version<
            T: std::convert::Into<crate::model::policy_based_route::filter::ProtocolVersion>,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.protocol_version = v.into();
            self
        }
    }

    impl wkt::message::Message for Filter {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter"
        }
    }

    /// Defines additional types related to [Filter].
    pub mod filter {
        #[allow(unused_imports)]
        use super::*;

        /// The internet protocol version.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum ProtocolVersion {
            /// Default value.
            Unspecified,
            /// The PBR is for IPv4 internet protocol traffic.
            Ipv4,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [ProtocolVersion::value] or
            /// [ProtocolVersion::name].
            UnknownValue(protocol_version::UnknownValue),
        }

        #[doc(hidden)]
        pub mod protocol_version {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl ProtocolVersion {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::Ipv4 => std::option::Option::Some(1),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("PROTOCOL_VERSION_UNSPECIFIED"),
                    Self::Ipv4 => std::option::Option::Some("IPV4"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for ProtocolVersion {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for ProtocolVersion {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for ProtocolVersion {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::Ipv4,
                    _ => Self::UnknownValue(protocol_version::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for ProtocolVersion {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "PROTOCOL_VERSION_UNSPECIFIED" => Self::Unspecified,
                    "IPV4" => Self::Ipv4,
                    _ => Self::UnknownValue(protocol_version::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for ProtocolVersion {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::Ipv4 => serializer.serialize_i32(1),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for ProtocolVersion {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<ProtocolVersion>::new(
                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion",
                ))
            }
        }
    }

    /// Informational warning message.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Warnings {
        /// Output only. A warning code, if applicable.
        pub code: crate::model::policy_based_route::warnings::Code,

        /// Output only. Metadata about this warning in key: value format. The key
        /// should provides more detail on the warning being returned. For example,
        /// for warnings where there are no results in a list request for a
        /// particular zone, this key might be scope and the key value might be the
        /// zone name. Other examples might be a key indicating a deprecated resource
        /// and a suggested replacement.
        pub data: std::collections::HashMap<std::string::String, std::string::String>,

        /// Output only. A human-readable description of the warning code.
        pub warning_message: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Warnings {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [code][crate::model::policy_based_route::Warnings::code].
        pub fn set_code<T: std::convert::Into<crate::model::policy_based_route::warnings::Code>>(
            mut self,
            v: T,
        ) -> Self {
            self.code = v.into();
            self
        }

        /// Sets the value of [data][crate::model::policy_based_route::Warnings::data].
        pub fn set_data<T, K, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = (K, V)>,
            K: std::convert::Into<std::string::String>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
            self
        }

        /// Sets the value of [warning_message][crate::model::policy_based_route::Warnings::warning_message].
        pub fn set_warning_message<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.warning_message = v.into();
            self
        }
    }

    impl wkt::message::Message for Warnings {
        fn typename() -> &'static str {
            "type.googleapis.com/google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings"
        }
    }

    /// Defines additional types related to [Warnings].
    pub mod warnings {
        #[allow(unused_imports)]
        use super::*;

        /// Warning code for policy-based routing. Expect to add values in the
        /// future.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum Code {
            /// Default value.
            WarningUnspecified,
            /// The policy-based route is not active and functioning. Common causes are
            /// that the dependent network was deleted or the resource project was
            /// turned off.
            ResourceNotActive,
            /// The policy-based route is being modified (e.g. created/deleted) at this
            /// time.
            ResourceBeingModified,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [Code::value] or
            /// [Code::name].
            UnknownValue(code::UnknownValue),
        }

        #[doc(hidden)]
        pub mod code {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl Code {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::WarningUnspecified => std::option::Option::Some(0),
                    Self::ResourceNotActive => std::option::Option::Some(1),
                    Self::ResourceBeingModified => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::WarningUnspecified => std::option::Option::Some("WARNING_UNSPECIFIED"),
                    Self::ResourceNotActive => std::option::Option::Some("RESOURCE_NOT_ACTIVE"),
                    Self::ResourceBeingModified => {
                        std::option::Option::Some("RESOURCE_BEING_MODIFIED")
                    }
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for Code {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for Code {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for Code {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::WarningUnspecified,
                    1 => Self::ResourceNotActive,
                    2 => Self::ResourceBeingModified,
                    _ => Self::UnknownValue(code::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for Code {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "WARNING_UNSPECIFIED" => Self::WarningUnspecified,
                    "RESOURCE_NOT_ACTIVE" => Self::ResourceNotActive,
                    "RESOURCE_BEING_MODIFIED" => Self::ResourceBeingModified,
                    _ => Self::UnknownValue(code::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for Code {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::WarningUnspecified => serializer.serialize_i32(0),
                    Self::ResourceNotActive => serializer.serialize_i32(1),
                    Self::ResourceBeingModified => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for Code {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<Code>::new(
                    ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code",
                ))
            }
        }
    }

    /// The other routing cases.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum OtherRoutes {
        /// Default value.
        Unspecified,
        /// Use the routes from the default routing tables (system-generated routes,
        /// custom routes, peering route) to determine the next hop. This effectively
        /// excludes matching packets being applied on other PBRs with a lower
        /// priority.
        DefaultRouting,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [OtherRoutes::value] or
        /// [OtherRoutes::name].
        UnknownValue(other_routes::UnknownValue),
    }

    #[doc(hidden)]
    pub mod other_routes {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl OtherRoutes {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::DefaultRouting => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("OTHER_ROUTES_UNSPECIFIED"),
                Self::DefaultRouting => std::option::Option::Some("DEFAULT_ROUTING"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for OtherRoutes {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for OtherRoutes {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for OtherRoutes {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::DefaultRouting,
                _ => Self::UnknownValue(other_routes::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for OtherRoutes {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "OTHER_ROUTES_UNSPECIFIED" => Self::Unspecified,
                "DEFAULT_ROUTING" => Self::DefaultRouting,
                _ => Self::UnknownValue(other_routes::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for OtherRoutes {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::DefaultRouting => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for OtherRoutes {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<OtherRoutes>::new(
                ".google.cloud.networkconnectivity.v1.PolicyBasedRoute.OtherRoutes",
            ))
        }
    }

    /// Target specifies network endpoints that this policy-based route applies to.
    /// If no target is specified, the PBR will be installed on all network
    /// endpoints (e.g. VMs, VPNs, and Interconnects) in the VPC.
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum Target {
        /// Optional. VM instances that this policy-based route applies to.
        VirtualMachine(std::boxed::Box<crate::model::policy_based_route::VirtualMachine>),
        /// Optional. The interconnect attachments that this policy-based route
        /// applies to.
        InterconnectAttachment(
            std::boxed::Box<crate::model::policy_based_route::InterconnectAttachment>,
        ),
    }

    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum NextHop {
        /// Optional. The IP address of a global-access-enabled L4 ILB that is the
        /// next hop for matching packets. For this version, only nextHopIlbIp is
        /// supported.
        NextHopIlbIp(std::string::String),
        /// Optional. Other routes that will be referenced to determine the next hop
        /// of the packet.
        NextHopOtherRoutes(crate::model::policy_based_route::OtherRoutes),
    }
}

/// Request for
/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
/// method.
///
/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPolicyBasedRoutesRequest {
    /// Required. The parent resource's name.
    pub parent: std::string::String,

    /// The maximum number of results per page that should be returned.
    pub page_size: i32,

    /// The page token.
    pub page_token: std::string::String,

    /// A filter expression that filters the results listed in the response.
    pub filter: std::string::String,

    /// Sort the results by a certain order.
    pub order_by: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPolicyBasedRoutesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListPolicyBasedRoutesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListPolicyBasedRoutesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListPolicyBasedRoutesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [filter][crate::model::ListPolicyBasedRoutesRequest::filter].
    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.filter = v.into();
        self
    }

    /// Sets the value of [order_by][crate::model::ListPolicyBasedRoutesRequest::order_by].
    pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.order_by = v.into();
        self
    }
}

impl wkt::message::Message for ListPolicyBasedRoutesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest"
    }
}

/// Response for
/// [PolicyBasedRoutingService.ListPolicyBasedRoutes][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]
/// method.
///
/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes]: crate::client::PolicyBasedRoutingService::list_policy_based_routes
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListPolicyBasedRoutesResponse {
    /// Policy-based routes to be returned.
    pub policy_based_routes: std::vec::Vec<crate::model::PolicyBasedRoute>,

    /// The next pagination token in the List response. It should be used as
    /// page_token for the following request. An empty value means no more result.
    pub next_page_token: std::string::String,

    /// Locations that could not be reached.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListPolicyBasedRoutesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [policy_based_routes][crate::model::ListPolicyBasedRoutesResponse::policy_based_routes].
    pub fn set_policy_based_routes<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::PolicyBasedRoute>,
    {
        use std::iter::Iterator;
        self.policy_based_routes = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListPolicyBasedRoutesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListPolicyBasedRoutesResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListPolicyBasedRoutesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListPolicyBasedRoutesResponse {
    type PageItem = crate::model::PolicyBasedRoute;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.policy_based_routes
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request for
/// [PolicyBasedRoutingService.GetPolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]
/// method.
///
/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute]: crate::client::PolicyBasedRoutingService::get_policy_based_route
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPolicyBasedRouteRequest {
    /// Required. Name of the PolicyBasedRoute resource to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetPolicyBasedRouteRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetPolicyBasedRouteRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetPolicyBasedRouteRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest"
    }
}

/// Request for
/// [PolicyBasedRoutingService.CreatePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]
/// method.
///
/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::create_policy_based_route
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreatePolicyBasedRouteRequest {
    /// Required. The parent resource's name of the PolicyBasedRoute.
    pub parent: std::string::String,

    /// Required. Unique id for the policy-based route to create. Provided by the
    /// client when the resource is created. The name must comply with
    /// <https://google.aip.dev/122#resource-id-segments>. Specifically, the name
    /// must be 1-63 characters long and match the regular expression
    /// [a-z]([a-z0-9-]*[a-z0-9])?. The first character must be a lowercase letter,
    /// and all following characters (except for the last character) must be a
    /// dash, lowercase letter, or digit. The last character must be a lowercase
    /// letter or digit.
    pub policy_based_route_id: std::string::String,

    /// Required. Initial values for a new policy-based route.
    pub policy_based_route: std::option::Option<crate::model::PolicyBasedRoute>,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server knows to
    /// ignore the request if it has already been completed. The server guarantees
    /// that for at least 60 minutes since the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, ignores the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreatePolicyBasedRouteRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreatePolicyBasedRouteRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [policy_based_route_id][crate::model::CreatePolicyBasedRouteRequest::policy_based_route_id].
    pub fn set_policy_based_route_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.policy_based_route_id = v.into();
        self
    }

    /// Sets the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
    pub fn set_policy_based_route<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PolicyBasedRoute>,
    {
        self.policy_based_route = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [policy_based_route][crate::model::CreatePolicyBasedRouteRequest::policy_based_route].
    pub fn set_or_clear_policy_based_route<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PolicyBasedRoute>,
    {
        self.policy_based_route = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreatePolicyBasedRouteRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreatePolicyBasedRouteRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest"
    }
}

/// Request for
/// [PolicyBasedRoutingService.DeletePolicyBasedRoute][google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]
/// method.
///
/// [google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute]: crate::client::PolicyBasedRoutingService::delete_policy_based_route
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletePolicyBasedRouteRequest {
    /// Required. Name of the policy-based route resource to delete.
    pub name: std::string::String,

    /// Optional. An optional request ID to identify requests. Specify a unique
    /// request ID so that if you must retry your request, the server knows to
    /// ignore the request if it has already been completed. The server guarantees
    /// that for at least 60 minutes after the first request.
    ///
    /// For example, consider a situation where you make an initial request and
    /// the request times out. If you make the request again with the same request
    /// ID, the server can check if original operation with the same request ID
    /// was received, and if so, ignores the second request. This prevents clients
    /// from accidentally creating duplicate commitments.
    ///
    /// The request ID must be a valid UUID with the exception that zero UUID is
    /// not supported (00000000-0000-0000-0000-000000000000).
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeletePolicyBasedRouteRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeletePolicyBasedRouteRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeletePolicyBasedRouteRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeletePolicyBasedRouteRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest"
    }
}

/// The infrastructure used for connections between consumers/producers.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Infrastructure {
    /// An invalid infrastructure as the default case.
    Unspecified,
    /// Private Service Connect is used for connections.
    Psc,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [Infrastructure::value] or
    /// [Infrastructure::name].
    UnknownValue(infrastructure::UnknownValue),
}

#[doc(hidden)]
pub mod infrastructure {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl Infrastructure {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Psc => std::option::Option::Some(1),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("INFRASTRUCTURE_UNSPECIFIED"),
            Self::Psc => std::option::Option::Some("PSC"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for Infrastructure {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for Infrastructure {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for Infrastructure {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Psc,
            _ => Self::UnknownValue(infrastructure::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for Infrastructure {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "INFRASTRUCTURE_UNSPECIFIED" => Self::Unspecified,
            "PSC" => Self::Psc,
            _ => Self::UnknownValue(infrastructure::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for Infrastructure {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Psc => serializer.serialize_i32(1),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for Infrastructure {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Infrastructure>::new(
            ".google.cloud.networkconnectivity.v1.Infrastructure",
        ))
    }
}

/// The error type indicates whether a connection error is consumer facing,
/// producer facing or system internal.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ConnectionErrorType {
    /// An invalid error type as the default case.
    Unspecified,
    /// The error is due to Service Automation system internal.
    ErrorInternal,
    /// The error is due to the setup on consumer side.
    ErrorConsumerSide,
    /// The error is due to the setup on producer side.
    ErrorProducerSide,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [ConnectionErrorType::value] or
    /// [ConnectionErrorType::name].
    UnknownValue(connection_error_type::UnknownValue),
}

#[doc(hidden)]
pub mod connection_error_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl ConnectionErrorType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::ErrorInternal => std::option::Option::Some(1),
            Self::ErrorConsumerSide => std::option::Option::Some(2),
            Self::ErrorProducerSide => std::option::Option::Some(3),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("CONNECTION_ERROR_TYPE_UNSPECIFIED"),
            Self::ErrorInternal => std::option::Option::Some("ERROR_INTERNAL"),
            Self::ErrorConsumerSide => std::option::Option::Some("ERROR_CONSUMER_SIDE"),
            Self::ErrorProducerSide => std::option::Option::Some("ERROR_PRODUCER_SIDE"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for ConnectionErrorType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for ConnectionErrorType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for ConnectionErrorType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::ErrorInternal,
            2 => Self::ErrorConsumerSide,
            3 => Self::ErrorProducerSide,
            _ => Self::UnknownValue(connection_error_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for ConnectionErrorType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "CONNECTION_ERROR_TYPE_UNSPECIFIED" => Self::Unspecified,
            "ERROR_INTERNAL" => Self::ErrorInternal,
            "ERROR_CONSUMER_SIDE" => Self::ErrorConsumerSide,
            "ERROR_PRODUCER_SIDE" => Self::ErrorProducerSide,
            _ => Self::UnknownValue(connection_error_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for ConnectionErrorType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::ErrorInternal => serializer.serialize_i32(1),
            Self::ErrorConsumerSide => serializer.serialize_i32(2),
            Self::ErrorProducerSide => serializer.serialize_i32(3),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for ConnectionErrorType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<ConnectionErrorType>::new(
            ".google.cloud.networkconnectivity.v1.ConnectionErrorType",
        ))
    }
}

/// The requested IP version for the PSC connection.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IPVersion {
    /// Default value. We will use IPv4 or IPv6 depending on the IP version of
    /// first available subnetwork.
    Unspecified,
    /// Will use IPv4 only.
    Ipv4,
    /// Will use IPv6 only.
    Ipv6,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [IPVersion::value] or
    /// [IPVersion::name].
    UnknownValue(ip_version::UnknownValue),
}

#[doc(hidden)]
pub mod ip_version {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl IPVersion {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Ipv4 => std::option::Option::Some(1),
            Self::Ipv6 => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("IP_VERSION_UNSPECIFIED"),
            Self::Ipv4 => std::option::Option::Some("IPV4"),
            Self::Ipv6 => std::option::Option::Some("IPV6"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for IPVersion {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for IPVersion {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for IPVersion {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Ipv4,
            2 => Self::Ipv6,
            _ => Self::UnknownValue(ip_version::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for IPVersion {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "IP_VERSION_UNSPECIFIED" => Self::Unspecified,
            "IPV4" => Self::Ipv4,
            "IPV6" => Self::Ipv6,
            _ => Self::UnknownValue(ip_version::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for IPVersion {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Ipv4 => serializer.serialize_i32(1),
            Self::Ipv6 => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for IPVersion {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<IPVersion>::new(
            ".google.cloud.networkconnectivity.v1.IPVersion",
        ))
    }
}

/// Supported features for a location
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LocationFeature {
    /// No publicly supported feature in this location
    Unspecified,
    /// Site-to-cloud spokes are supported in this location
    SiteToCloudSpokes,
    /// Site-to-site spokes are supported in this location
    SiteToSiteSpokes,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [LocationFeature::value] or
    /// [LocationFeature::name].
    UnknownValue(location_feature::UnknownValue),
}

#[doc(hidden)]
pub mod location_feature {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl LocationFeature {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::SiteToCloudSpokes => std::option::Option::Some(1),
            Self::SiteToSiteSpokes => std::option::Option::Some(2),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("LOCATION_FEATURE_UNSPECIFIED"),
            Self::SiteToCloudSpokes => std::option::Option::Some("SITE_TO_CLOUD_SPOKES"),
            Self::SiteToSiteSpokes => std::option::Option::Some("SITE_TO_SITE_SPOKES"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for LocationFeature {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for LocationFeature {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for LocationFeature {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::SiteToCloudSpokes,
            2 => Self::SiteToSiteSpokes,
            _ => Self::UnknownValue(location_feature::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for LocationFeature {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "LOCATION_FEATURE_UNSPECIFIED" => Self::Unspecified,
            "SITE_TO_CLOUD_SPOKES" => Self::SiteToCloudSpokes,
            "SITE_TO_SITE_SPOKES" => Self::SiteToSiteSpokes,
            _ => Self::UnknownValue(location_feature::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for LocationFeature {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::SiteToCloudSpokes => serializer.serialize_i32(1),
            Self::SiteToSiteSpokes => serializer.serialize_i32(2),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for LocationFeature {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<LocationFeature>::new(
            ".google.cloud.networkconnectivity.v1.LocationFeature",
        ))
    }
}

/// The route's type
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RouteType {
    /// No route type information specified
    Unspecified,
    /// The route leads to a destination within the primary address range of the
    /// VPC network's subnet.
    VpcPrimarySubnet,
    /// The route leads to a destination within the secondary address range of the
    /// VPC network's subnet.
    VpcSecondarySubnet,
    /// The route leads to a destination in a dynamic route. Dynamic routes are
    /// derived from Border Gateway Protocol (BGP) advertisements received from an
    /// NCC hybrid spoke.
    DynamicRoute,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [RouteType::value] or
    /// [RouteType::name].
    UnknownValue(route_type::UnknownValue),
}

#[doc(hidden)]
pub mod route_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl RouteType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::VpcPrimarySubnet => std::option::Option::Some(1),
            Self::VpcSecondarySubnet => std::option::Option::Some(2),
            Self::DynamicRoute => std::option::Option::Some(3),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("ROUTE_TYPE_UNSPECIFIED"),
            Self::VpcPrimarySubnet => std::option::Option::Some("VPC_PRIMARY_SUBNET"),
            Self::VpcSecondarySubnet => std::option::Option::Some("VPC_SECONDARY_SUBNET"),
            Self::DynamicRoute => std::option::Option::Some("DYNAMIC_ROUTE"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for RouteType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for RouteType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for RouteType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::VpcPrimarySubnet,
            2 => Self::VpcSecondarySubnet,
            3 => Self::DynamicRoute,
            _ => Self::UnknownValue(route_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for RouteType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "ROUTE_TYPE_UNSPECIFIED" => Self::Unspecified,
            "VPC_PRIMARY_SUBNET" => Self::VpcPrimarySubnet,
            "VPC_SECONDARY_SUBNET" => Self::VpcSecondarySubnet,
            "DYNAMIC_ROUTE" => Self::DynamicRoute,
            _ => Self::UnknownValue(route_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for RouteType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::VpcPrimarySubnet => serializer.serialize_i32(1),
            Self::VpcSecondarySubnet => serializer.serialize_i32(2),
            Self::DynamicRoute => serializer.serialize_i32(3),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for RouteType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<RouteType>::new(
            ".google.cloud.networkconnectivity.v1.RouteType",
        ))
    }
}

/// The State enum represents the lifecycle stage of a Network Connectivity
/// Center resource.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
    /// No state information available
    Unspecified,
    /// The resource's create operation is in progress.
    Creating,
    /// The resource is active
    Active,
    /// The resource's delete operation is in progress.
    Deleting,
    /// The resource's accept operation is in progress.
    Accepting,
    /// The resource's reject operation is in progress.
    Rejecting,
    /// The resource's update operation is in progress.
    Updating,
    /// The resource is inactive.
    Inactive,
    /// The hub associated with this spoke resource has been deleted.
    /// This state applies to spoke resources only.
    Obsolete,
    /// The resource is in an undefined state due to resource creation or deletion
    /// failure. You can try to delete the resource later or contact support for
    /// help.
    Failed,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [State::value] or
    /// [State::name].
    UnknownValue(state::UnknownValue),
}

#[doc(hidden)]
pub mod state {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl State {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Creating => std::option::Option::Some(1),
            Self::Active => std::option::Option::Some(2),
            Self::Deleting => std::option::Option::Some(3),
            Self::Accepting => std::option::Option::Some(8),
            Self::Rejecting => std::option::Option::Some(9),
            Self::Updating => std::option::Option::Some(6),
            Self::Inactive => std::option::Option::Some(7),
            Self::Obsolete => std::option::Option::Some(10),
            Self::Failed => std::option::Option::Some(11),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
            Self::Creating => std::option::Option::Some("CREATING"),
            Self::Active => std::option::Option::Some("ACTIVE"),
            Self::Deleting => std::option::Option::Some("DELETING"),
            Self::Accepting => std::option::Option::Some("ACCEPTING"),
            Self::Rejecting => std::option::Option::Some("REJECTING"),
            Self::Updating => std::option::Option::Some("UPDATING"),
            Self::Inactive => std::option::Option::Some("INACTIVE"),
            Self::Obsolete => std::option::Option::Some("OBSOLETE"),
            Self::Failed => std::option::Option::Some("FAILED"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for State {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for State {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for State {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Creating,
            2 => Self::Active,
            3 => Self::Deleting,
            6 => Self::Updating,
            7 => Self::Inactive,
            8 => Self::Accepting,
            9 => Self::Rejecting,
            10 => Self::Obsolete,
            11 => Self::Failed,
            _ => Self::UnknownValue(state::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for State {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "STATE_UNSPECIFIED" => Self::Unspecified,
            "CREATING" => Self::Creating,
            "ACTIVE" => Self::Active,
            "DELETING" => Self::Deleting,
            "ACCEPTING" => Self::Accepting,
            "REJECTING" => Self::Rejecting,
            "UPDATING" => Self::Updating,
            "INACTIVE" => Self::Inactive,
            "OBSOLETE" => Self::Obsolete,
            "FAILED" => Self::Failed,
            _ => Self::UnknownValue(state::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for State {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Creating => serializer.serialize_i32(1),
            Self::Active => serializer.serialize_i32(2),
            Self::Deleting => serializer.serialize_i32(3),
            Self::Accepting => serializer.serialize_i32(8),
            Self::Rejecting => serializer.serialize_i32(9),
            Self::Updating => serializer.serialize_i32(6),
            Self::Inactive => serializer.serialize_i32(7),
            Self::Obsolete => serializer.serialize_i32(10),
            Self::Failed => serializer.serialize_i32(11),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for State {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
            ".google.cloud.networkconnectivity.v1.State",
        ))
    }
}

/// The SpokeType enum represents the type of spoke. The type
/// reflects the kind of resource that a spoke is associated with.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpokeType {
    /// Unspecified spoke type.
    Unspecified,
    /// Spokes associated with VPN tunnels.
    VpnTunnel,
    /// Spokes associated with VLAN attachments.
    InterconnectAttachment,
    /// Spokes associated with router appliance instances.
    RouterAppliance,
    /// Spokes associated with VPC networks.
    VpcNetwork,
    /// Spokes that are backed by a producer VPC network.
    ProducerVpcNetwork,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [SpokeType::value] or
    /// [SpokeType::name].
    UnknownValue(spoke_type::UnknownValue),
}

#[doc(hidden)]
pub mod spoke_type {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl SpokeType {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::VpnTunnel => std::option::Option::Some(1),
            Self::InterconnectAttachment => std::option::Option::Some(2),
            Self::RouterAppliance => std::option::Option::Some(3),
            Self::VpcNetwork => std::option::Option::Some(4),
            Self::ProducerVpcNetwork => std::option::Option::Some(7),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("SPOKE_TYPE_UNSPECIFIED"),
            Self::VpnTunnel => std::option::Option::Some("VPN_TUNNEL"),
            Self::InterconnectAttachment => std::option::Option::Some("INTERCONNECT_ATTACHMENT"),
            Self::RouterAppliance => std::option::Option::Some("ROUTER_APPLIANCE"),
            Self::VpcNetwork => std::option::Option::Some("VPC_NETWORK"),
            Self::ProducerVpcNetwork => std::option::Option::Some("PRODUCER_VPC_NETWORK"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for SpokeType {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for SpokeType {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for SpokeType {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::VpnTunnel,
            2 => Self::InterconnectAttachment,
            3 => Self::RouterAppliance,
            4 => Self::VpcNetwork,
            7 => Self::ProducerVpcNetwork,
            _ => Self::UnknownValue(spoke_type::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for SpokeType {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "SPOKE_TYPE_UNSPECIFIED" => Self::Unspecified,
            "VPN_TUNNEL" => Self::VpnTunnel,
            "INTERCONNECT_ATTACHMENT" => Self::InterconnectAttachment,
            "ROUTER_APPLIANCE" => Self::RouterAppliance,
            "VPC_NETWORK" => Self::VpcNetwork,
            "PRODUCER_VPC_NETWORK" => Self::ProducerVpcNetwork,
            _ => Self::UnknownValue(spoke_type::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for SpokeType {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::VpnTunnel => serializer.serialize_i32(1),
            Self::InterconnectAttachment => serializer.serialize_i32(2),
            Self::RouterAppliance => serializer.serialize_i32(3),
            Self::VpcNetwork => serializer.serialize_i32(4),
            Self::ProducerVpcNetwork => serializer.serialize_i32(7),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for SpokeType {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpokeType>::new(
            ".google.cloud.networkconnectivity.v1.SpokeType",
        ))
    }
}

/// This enum controls the policy mode used in a hub.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PolicyMode {
    /// Policy mode is unspecified. It defaults to PRESET
    /// with preset_topology = MESH.
    Unspecified,
    /// Hub uses one of the preset topologies.
    Preset,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [PolicyMode::value] or
    /// [PolicyMode::name].
    UnknownValue(policy_mode::UnknownValue),
}

#[doc(hidden)]
pub mod policy_mode {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl PolicyMode {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Preset => std::option::Option::Some(1),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("POLICY_MODE_UNSPECIFIED"),
            Self::Preset => std::option::Option::Some("PRESET"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for PolicyMode {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for PolicyMode {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for PolicyMode {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            1 => Self::Preset,
            _ => Self::UnknownValue(policy_mode::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for PolicyMode {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "POLICY_MODE_UNSPECIFIED" => Self::Unspecified,
            "PRESET" => Self::Preset,
            _ => Self::UnknownValue(policy_mode::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for PolicyMode {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Preset => serializer.serialize_i32(1),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for PolicyMode {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PolicyMode>::new(
            ".google.cloud.networkconnectivity.v1.PolicyMode",
        ))
    }
}

/// The list of available preset topologies.
///
/// # Working with unknown values
///
/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
/// additional enum variants at any time. Adding new variants is not considered
/// a breaking change. Applications should write their code in anticipation of:
///
/// - New values appearing in future releases of the client library, **and**
/// - New values received dynamically, without application changes.
///
/// Please consult the [Working with enums] section in the user guide for some
/// guidelines.
///
/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PresetTopology {
    /// Preset topology is unspecified. When policy_mode = PRESET,
    /// it defaults to MESH.
    Unspecified,
    /// Mesh topology is implemented. Group `default` is automatically created.
    /// All spokes in the hub are added to group `default`.
    Mesh,
    /// Star topology is implemented. Two groups, `center` and `edge`, are
    /// automatically created along with hub creation. Spokes have to join one of
    /// the groups during creation.
    Star,
    /// If set, the enum was initialized with an unknown value.
    ///
    /// Applications can examine the value using [PresetTopology::value] or
    /// [PresetTopology::name].
    UnknownValue(preset_topology::UnknownValue),
}

#[doc(hidden)]
pub mod preset_topology {
    #[allow(unused_imports)]
    use super::*;
    #[derive(Clone, Debug, PartialEq)]
    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}

impl PresetTopology {
    /// Gets the enum value.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the string representation of enums.
    pub fn value(&self) -> std::option::Option<i32> {
        match self {
            Self::Unspecified => std::option::Option::Some(0),
            Self::Mesh => std::option::Option::Some(2),
            Self::Star => std::option::Option::Some(3),
            Self::UnknownValue(u) => u.0.value(),
        }
    }

    /// Gets the enum value as a string.
    ///
    /// Returns `None` if the enum contains an unknown value deserialized from
    /// the integer representation of enums.
    pub fn name(&self) -> std::option::Option<&str> {
        match self {
            Self::Unspecified => std::option::Option::Some("PRESET_TOPOLOGY_UNSPECIFIED"),
            Self::Mesh => std::option::Option::Some("MESH"),
            Self::Star => std::option::Option::Some("STAR"),
            Self::UnknownValue(u) => u.0.name(),
        }
    }
}

impl std::default::Default for PresetTopology {
    fn default() -> Self {
        use std::convert::From;
        Self::from(0)
    }
}

impl std::fmt::Display for PresetTopology {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
        wkt::internal::display_enum(f, self.name(), self.value())
    }
}

impl std::convert::From<i32> for PresetTopology {
    fn from(value: i32) -> Self {
        match value {
            0 => Self::Unspecified,
            2 => Self::Mesh,
            3 => Self::Star,
            _ => Self::UnknownValue(preset_topology::UnknownValue(
                wkt::internal::UnknownEnumValue::Integer(value),
            )),
        }
    }
}

impl std::convert::From<&str> for PresetTopology {
    fn from(value: &str) -> Self {
        use std::string::ToString;
        match value {
            "PRESET_TOPOLOGY_UNSPECIFIED" => Self::Unspecified,
            "MESH" => Self::Mesh,
            "STAR" => Self::Star,
            _ => Self::UnknownValue(preset_topology::UnknownValue(
                wkt::internal::UnknownEnumValue::String(value.to_string()),
            )),
        }
    }
}

impl serde::ser::Serialize for PresetTopology {
    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        match self {
            Self::Unspecified => serializer.serialize_i32(0),
            Self::Mesh => serializer.serialize_i32(2),
            Self::Star => serializer.serialize_i32(3),
            Self::UnknownValue(u) => u.0.serialize(serializer),
        }
    }
}

impl<'de> serde::de::Deserialize<'de> for PresetTopology {
    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        deserializer.deserialize_any(wkt::internal::EnumVisitor::<PresetTopology>::new(
            ".google.cloud.networkconnectivity.v1.PresetTopology",
        ))
    }
}
